@orchesty/connector-upgates 1.0.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.
Files changed (123) hide show
  1. package/CHANGELOG.md +7 -0
  2. package/LICENSE +190 -0
  3. package/coverage/clover.xml +302 -0
  4. package/coverage/coverage-final.json +11 -0
  5. package/coverage/lcov-report/base.css +224 -0
  6. package/coverage/lcov-report/block-navigation.js +87 -0
  7. package/coverage/lcov-report/favicon.png +0 -0
  8. package/coverage/lcov-report/index.html +161 -0
  9. package/coverage/lcov-report/prettify.css +1 -0
  10. package/coverage/lcov-report/prettify.js +2 -0
  11. package/coverage/lcov-report/sort-arrow-sprite.png +0 -0
  12. package/coverage/lcov-report/sorter.js +210 -0
  13. package/coverage/lcov-report/src/Batch/UpgatesCreateWebhooks.ts.html +358 -0
  14. package/coverage/lcov-report/src/Batch/UpgatesGetOrders.ts.html +727 -0
  15. package/coverage/lcov-report/src/Batch/UpgatesGetProducts.ts.html +733 -0
  16. package/coverage/lcov-report/src/Batch/index.html +146 -0
  17. package/coverage/lcov-report/src/Connector/UpgatesDeleteWebhooks.ts.html +370 -0
  18. package/coverage/lcov-report/src/Connector/UpgatesGetOrderStates.ts.html +190 -0
  19. package/coverage/lcov-report/src/Connector/UpgatesGetPayments.ts.html +268 -0
  20. package/coverage/lcov-report/src/Connector/UpgatesGetProductParameters.ts.html +316 -0
  21. package/coverage/lcov-report/src/Connector/UpgatesGetShipments.ts.html +274 -0
  22. package/coverage/lcov-report/src/Connector/index.html +176 -0
  23. package/coverage/lcov-report/src/UpgatesApplication.ts.html +379 -0
  24. package/coverage/lcov-report/src/index.html +116 -0
  25. package/coverage/lcov-report/test/dataProvider.ts.html +223 -0
  26. package/coverage/lcov-report/test/index.html +116 -0
  27. package/coverage/lcov.info +485 -0
  28. package/dist/Batch/UpgatesCreateWebhooks.d.ts +17 -0
  29. package/dist/Batch/UpgatesCreateWebhooks.js +61 -0
  30. package/dist/Batch/UpgatesGetOrders.d.ts +148 -0
  31. package/dist/Batch/UpgatesGetOrders.js +51 -0
  32. package/dist/Batch/UpgatesGetProducts.d.ts +146 -0
  33. package/dist/Batch/UpgatesGetProducts.js +70 -0
  34. package/dist/Connector/UpgatesDeleteWebhooks.d.ts +15 -0
  35. package/dist/Connector/UpgatesDeleteWebhooks.js +62 -0
  36. package/dist/Connector/UpgatesGetOrderStates.d.ts +15 -0
  37. package/dist/Connector/UpgatesGetOrderStates.js +21 -0
  38. package/dist/Connector/UpgatesGetPayments.d.ts +38 -0
  39. package/dist/Connector/UpgatesGetPayments.js +21 -0
  40. package/dist/Connector/UpgatesGetProductParameters.d.ts +37 -0
  41. package/dist/Connector/UpgatesGetProductParameters.js +33 -0
  42. package/dist/Connector/UpgatesGetShipments.d.ts +40 -0
  43. package/dist/Connector/UpgatesGetShipments.js +21 -0
  44. package/dist/Connector/UpgatesUpdateOrder.d.ts +37 -0
  45. package/dist/Connector/UpgatesUpdateOrder.js +24 -0
  46. package/dist/Connector/UpgatesUpdateStock.d.ts +21 -0
  47. package/dist/Connector/UpgatesUpdateStock.js +24 -0
  48. package/dist/UpgatesApplication.d.ts +21 -0
  49. package/dist/UpgatesApplication.js +105 -0
  50. package/dist/package.json +27 -0
  51. package/jest.config.js +13 -0
  52. package/package.json +27 -0
  53. package/src/Batch/UpgatesCreateWebhooks.ts +91 -0
  54. package/src/Batch/UpgatesGetOrders.ts +214 -0
  55. package/src/Batch/UpgatesGetProducts.ts +216 -0
  56. package/src/Batch/__tests__/Data/UpgatesCreateWebhooks/input.json +6 -0
  57. package/src/Batch/__tests__/Data/UpgatesCreateWebhooks/mock.json +14 -0
  58. package/src/Batch/__tests__/Data/UpgatesCreateWebhooks/output.json +6 -0
  59. package/src/Batch/__tests__/Data/UpgatesGetOrders/input.json +6 -0
  60. package/src/Batch/__tests__/Data/UpgatesGetOrders/lastRun-input.json +6 -0
  61. package/src/Batch/__tests__/Data/UpgatesGetOrders/lastRun-mock.json +191 -0
  62. package/src/Batch/__tests__/Data/UpgatesGetOrders/lastRun-output.json +11 -0
  63. package/src/Batch/__tests__/Data/UpgatesGetOrders/mock.json +191 -0
  64. package/src/Batch/__tests__/Data/UpgatesGetOrders/orderNumber-input.json +8 -0
  65. package/src/Batch/__tests__/Data/UpgatesGetOrders/orderNumber-mock.json +191 -0
  66. package/src/Batch/__tests__/Data/UpgatesGetOrders/orderNumber-output.json +11 -0
  67. package/src/Batch/__tests__/Data/UpgatesGetOrders/orderNumbers-input.json +8 -0
  68. package/src/Batch/__tests__/Data/UpgatesGetOrders/orderNumbers-mock.json +191 -0
  69. package/src/Batch/__tests__/Data/UpgatesGetOrders/orderNumbers-output.json +11 -0
  70. package/src/Batch/__tests__/Data/UpgatesGetOrders/output.json +11 -0
  71. package/src/Batch/__tests__/Data/UpgatesGetProducts/input.json +6 -0
  72. package/src/Batch/__tests__/Data/UpgatesGetProducts/lastRun-input.json +6 -0
  73. package/src/Batch/__tests__/Data/UpgatesGetProducts/lastRun-mock.json +147 -0
  74. package/src/Batch/__tests__/Data/UpgatesGetProducts/lastRun-output.json +11 -0
  75. package/src/Batch/__tests__/Data/UpgatesGetProducts/mock.json +146 -0
  76. package/src/Batch/__tests__/Data/UpgatesGetProducts/output.json +11 -0
  77. package/src/Batch/__tests__/Data/UpgatesGetProducts/productId-input.json +8 -0
  78. package/src/Batch/__tests__/Data/UpgatesGetProducts/productId-mock.json +146 -0
  79. package/src/Batch/__tests__/Data/UpgatesGetProducts/productId-output.json +11 -0
  80. package/src/Batch/__tests__/Data/UpgatesGetProducts/productIds-input.json +8 -0
  81. package/src/Batch/__tests__/Data/UpgatesGetProducts/productIds-mock.json +146 -0
  82. package/src/Batch/__tests__/Data/UpgatesGetProducts/productIds-output.json +11 -0
  83. package/src/Batch/__tests__/UpgatesCreateWebhooks.ts +17 -0
  84. package/src/Batch/__tests__/UpgatesGetOrders.ts +33 -0
  85. package/src/Batch/__tests__/UpgatesGetProducts.ts +33 -0
  86. package/src/Connector/UpgatesDeleteWebhooks.ts +95 -0
  87. package/src/Connector/UpgatesGetOrderStates.ts +35 -0
  88. package/src/Connector/UpgatesGetPayments.ts +61 -0
  89. package/src/Connector/UpgatesGetProductParameters.ts +77 -0
  90. package/src/Connector/UpgatesGetShipments.ts +63 -0
  91. package/src/Connector/UpgatesUpdateOrder.ts +73 -0
  92. package/src/Connector/UpgatesUpdateStock.ts +59 -0
  93. package/src/Connector/__tests__/Data/UpgatesDeleteWebhooks/input.json +6 -0
  94. package/src/Connector/__tests__/Data/UpgatesDeleteWebhooks/mock.json +16 -0
  95. package/src/Connector/__tests__/Data/UpgatesDeleteWebhooks/output.json +6 -0
  96. package/src/Connector/__tests__/Data/UpgatesGetOrderStates/input.json +6 -0
  97. package/src/Connector/__tests__/Data/UpgatesGetOrderStates/mock.json +14 -0
  98. package/src/Connector/__tests__/Data/UpgatesGetOrderStates/output.json +15 -0
  99. package/src/Connector/__tests__/Data/UpgatesGetPayments/input.json +6 -0
  100. package/src/Connector/__tests__/Data/UpgatesGetPayments/mock.json +42 -0
  101. package/src/Connector/__tests__/Data/UpgatesGetPayments/output.json +43 -0
  102. package/src/Connector/__tests__/Data/UpgatesGetProductParameters/both-input.json +9 -0
  103. package/src/Connector/__tests__/Data/UpgatesGetProductParameters/both-mock.json +108 -0
  104. package/src/Connector/__tests__/Data/UpgatesGetProductParameters/both-output.json +109 -0
  105. package/src/Connector/__tests__/Data/UpgatesGetProductParameters/input.json +8 -0
  106. package/src/Connector/__tests__/Data/UpgatesGetProductParameters/mock.json +108 -0
  107. package/src/Connector/__tests__/Data/UpgatesGetProductParameters/none-input.json +6 -0
  108. package/src/Connector/__tests__/Data/UpgatesGetProductParameters/none-mock.json +5 -0
  109. package/src/Connector/__tests__/Data/UpgatesGetProductParameters/none-output.json +6 -0
  110. package/src/Connector/__tests__/Data/UpgatesGetProductParameters/output.json +109 -0
  111. package/src/Connector/__tests__/Data/UpgatesGetShipments/input.json +6 -0
  112. package/src/Connector/__tests__/Data/UpgatesGetShipments/mock.json +58 -0
  113. package/src/Connector/__tests__/Data/UpgatesGetShipments/output.json +59 -0
  114. package/src/Connector/__tests__/UpgatesDeleteWebhooks.ts +61 -0
  115. package/src/Connector/__tests__/UpgatesGetOrderStates.ts +18 -0
  116. package/src/Connector/__tests__/UpgatesGetPayments.ts +18 -0
  117. package/src/Connector/__tests__/UpgatesGetProductParameters.ts +28 -0
  118. package/src/Connector/__tests__/UpgatesGetShipments.ts +18 -0
  119. package/src/UpgatesApplication.ts +98 -0
  120. package/test/dataProvider.ts +46 -0
  121. package/tsconfig.json +8 -0
  122. package/tsconfig.prod.json +13 -0
  123. package/tsconfig.prod.tsbuildinfo +1 -0
@@ -0,0 +1,216 @@
1
+ import ABatchNode from '@orchesty/nodejs-sdk/dist/lib/Batch/ABatchNode';
2
+ import { HttpMethods } from '@orchesty/nodejs-sdk/dist/lib/Transport/HttpMethods';
3
+ import BatchProcessDto from '@orchesty/nodejs-sdk/dist/lib/Utils/BatchProcessDto';
4
+ import { DateTime } from 'luxon';
5
+ import UpgatesApplication from '../UpgatesApplication';
6
+
7
+ const LIST_PAGE_ENDPOINT = 'api/v2/products';
8
+
9
+ export const NAME = 'upgates-get-products';
10
+
11
+ export default class UpgatesGetProducts extends ABatchNode {
12
+
13
+ public getName(): string {
14
+ return NAME;
15
+ }
16
+
17
+ public async processAction(dto: BatchProcessDto<IInput>): Promise<BatchProcessDto> {
18
+ const app = this.getApplication<UpgatesApplication>();
19
+ const appInstall = await this.getApplicationInstallFromProcess(dto);
20
+
21
+ const { from, productId, productIds } = dto.getJsonData();
22
+ const pageNumber = dto.getBatchCursor('1');
23
+
24
+ let url = LIST_PAGE_ENDPOINT;
25
+
26
+ if (productIds) {
27
+ url = `${url}?product_ids=${productIds}`;
28
+ } else if (productId) {
29
+ url = `${url}?product_id=${productId}`;
30
+ } else {
31
+ url = `${url}?page=${pageNumber}`;
32
+
33
+ const lastRun = from ?? app.getIsoDateFromDate(appInstall.getNonEncryptedSettings().productLastRun);
34
+ if (lastRun) {
35
+ url = `${url}&last_update_time_from=${lastRun}`;
36
+ }
37
+ }
38
+ const requestDto = app.getRequestDto(dto, appInstall, HttpMethods.GET, url);
39
+
40
+ const res = await this.getSender().send<IResponseJson>(requestDto);
41
+ const { number_of_pages, products } = res.getJsonBody();
42
+
43
+ if (Number(pageNumber) < number_of_pages) {
44
+ dto.setBatchCursor((Number(pageNumber) + 1).toString());
45
+ } else if (!productId) {
46
+ appInstall.setNonEncryptedSettings({ productLastRun: DateTime.now() });
47
+ const repo = this.getDbClient().getApplicationRepository();
48
+ await repo.update(appInstall);
49
+ }
50
+
51
+ dto.setItemList(products);
52
+
53
+ return dto;
54
+ }
55
+
56
+ }
57
+
58
+ /* eslint-disable @typescript-eslint/naming-convention */
59
+ interface IResponseJson extends IProductJson {
60
+ number_of_pages: number;
61
+ number_of_items: number;
62
+ }
63
+
64
+ export interface IProductJson {
65
+ products: IProduct[];
66
+ }
67
+
68
+ export interface IProduct {
69
+ code: string;
70
+ code_supplier: string;
71
+ ean: string;
72
+ product_id: number;
73
+ active_yn: boolean;
74
+ archived_yn: boolean;
75
+ replacement_product_code: string;
76
+ can_add_to_basket_yn: boolean;
77
+ adult_yn: boolean;
78
+ descriptions: IProductDescription[];
79
+ manufacturer: string;
80
+ stock: number;
81
+ stock_position: number;
82
+ availability: string;
83
+ availability_type: AvailabilityTypeEnum;
84
+ weight: number;
85
+ shipment_group: string;
86
+ images: IProductImage[];
87
+ categories: IProductCategories;
88
+ groups: number[];
89
+ prices: IProductPrice[];
90
+ vats: Record<string, number>;
91
+ parameters: IProductParameters[];
92
+ labels: IProductLabel[];
93
+ variants: IProductVariant[];
94
+ related: string[];
95
+ accessories: string[];
96
+ alternative: string[];
97
+ gifts: string[];
98
+ sets: string[];
99
+ metas: IProductVariantMeta[];
100
+ admin_url: string;
101
+ }
102
+
103
+ export interface IProductDescription {
104
+ language: string;
105
+ title: string;
106
+ short_description: string;
107
+ long_description: string;
108
+ url: string;
109
+ unit: string;
110
+ }
111
+
112
+ interface IProductImage {
113
+ url: string;
114
+ main_yn: boolean;
115
+ list_yn: boolean;
116
+ position: number;
117
+ titles: IProductImageTitle[];
118
+ }
119
+
120
+ interface IProductImageTitle {
121
+ language: string;
122
+ title: string;
123
+ }
124
+
125
+ interface IProductCategories {
126
+ category_id: number;
127
+ code: string;
128
+ main_yn: boolean;
129
+ position: number;
130
+ name: string;
131
+ }
132
+
133
+ interface IProductPrice {
134
+ language: string;
135
+ currency: string;
136
+ pricelists: IProductPricePriceList[];
137
+ }
138
+
139
+ interface IProductPricePriceList {
140
+ name: string;
141
+ price_original: number;
142
+ product_discount: number;
143
+ product_discount_real: number;
144
+ price_sale: number;
145
+ price_with_vat: number;
146
+ price_without_vat: number;
147
+ }
148
+
149
+ interface IProductParameters {
150
+ name: Record<string, string>;
151
+ values: Record<string, string>;
152
+ }
153
+
154
+ interface IProductLabel {
155
+ name: Record<string, string>;
156
+ active_yn: boolean;
157
+ active_from: Date;
158
+ active_to: Date;
159
+ }
160
+
161
+ interface IProductVariant {
162
+ code: string;
163
+ code_supplier: string;
164
+ ean: string;
165
+ variant_id: number;
166
+ active_yn: boolean;
167
+ can_add_to_basket_yn: boolean;
168
+ stock: number;
169
+ stock_position: string;
170
+ availability: string;
171
+ availability_type: AvailabilityTypeEnum;
172
+ weight: number;
173
+ image: string;
174
+ prices: IProductPrice[];
175
+ parameters: IProductParameters[];
176
+ labels: IProductLabel[];
177
+ metas: IProductVariantMeta[];
178
+ }
179
+
180
+ interface IProductVariantMeta {
181
+ key: string;
182
+ type: MetaTypeEnum;
183
+ value: string|boolean;
184
+ values: IProductVariantMetaValues[];
185
+ }
186
+
187
+ interface IProductVariantMetaValues {
188
+ language: string;
189
+ value: string;
190
+ }
191
+
192
+ export interface IInput {
193
+ from?: string;
194
+ productId?: string;
195
+ productIds?: string;
196
+ }
197
+
198
+ enum AvailabilityTypeEnum {
199
+ ON_REQUEST = 'OnRequest',
200
+ NOT_AVAILABLE = 'NotAvailable',
201
+ IN_STOCK = 'InStock',
202
+ CUSTOM = 'Custom',
203
+ }
204
+
205
+ enum MetaTypeEnum {
206
+ RADIO = 'radio',
207
+ CHECKBOX = 'checkbox',
208
+ INPUT = 'input',
209
+ DATE = 'date',
210
+ EMAIL = 'email',
211
+ NUMBER = 'number',
212
+ SELECT = 'select',
213
+ MULTISELECT = 'multiselect',
214
+ TEXTAREA = 'textarea',
215
+ FORMATTED = 'formatted',
216
+ }
@@ -0,0 +1,6 @@
1
+ {
2
+ "headers": {
3
+ "user": "TestUser"
4
+ },
5
+ "data": {}
6
+ }
@@ -0,0 +1,14 @@
1
+ {
2
+ "http": "POST https://private-anon-903e641b16-upgatesapiv2.apiary-mock.com/api/v2/webhooks",
3
+ "code": 200,
4
+ "body": {
5
+ "webhook": {
6
+ "id": 0,
7
+ "active_yn": false,
8
+ "name": "",
9
+ "url": "",
10
+ "event": ""
11
+ }
12
+ }
13
+ }
14
+
@@ -0,0 +1,6 @@
1
+ {
2
+ "headers": {
3
+ "user": "TestUser"
4
+ },
5
+ "data": []
6
+ }
@@ -0,0 +1,6 @@
1
+ {
2
+ "headers": {
3
+ "user": "TestUser"
4
+ },
5
+ "data": {}
6
+ }
@@ -0,0 +1,6 @@
1
+ {
2
+ "headers": {
3
+ "user": "TestUser"
4
+ },
5
+ "data": {}
6
+ }
@@ -0,0 +1,191 @@
1
+ {
2
+ "http": "GET https://private-anon-903e641b16-upgatesapiv2.apiary-mock.com/api/v2/orders?page=1&creation_time_from=2022-09-22T08:21:27",
3
+ "code": 200,
4
+ "body": {
5
+ "current_page": 0,
6
+ "current_page_items": 0,
7
+ "number_of_pages": 0,
8
+ "number_of_items": 0,
9
+ "orders": [
10
+ {
11
+ "order_number": "",
12
+ "case_number": "",
13
+ "external_order_number": "",
14
+ "language_id": "",
15
+ "currency_id": "",
16
+ "default_currency_rate": "",
17
+ "prices_with_vat_yn": false,
18
+ "status_id": 0,
19
+ "status": "",
20
+ "paid_date": "",
21
+ "tracking_code": "",
22
+ "tracking_url": "",
23
+ "resolved_yn": false,
24
+ "oss_yn": false,
25
+ "internal_note": "",
26
+ "last_update_time": "",
27
+ "creation_time": "",
28
+ "variable_symbol": "",
29
+ "total_weight": 0,
30
+ "order_total": 0,
31
+ "order_total_before_round": 0,
32
+ "order_total_rest": 0,
33
+ "invoice_number": "",
34
+ "origin": "admin",
35
+ "admin_url": "",
36
+ "customer": {
37
+ "email": "",
38
+ "phone": "",
39
+ "code": "",
40
+ "customer_id": 0,
41
+ "customer_pricelist_id": "",
42
+ "pricelist_name": "",
43
+ "pricelist_percent": "",
44
+ "firstname_invoice": "",
45
+ "surname_invoice": "",
46
+ "street_invoice": "",
47
+ "city_invoice": "",
48
+ "state_invoice": "",
49
+ "zip_invoice": "",
50
+ "country_id_invoice": "",
51
+ "postal_yn": false,
52
+ "firstname_postal": "",
53
+ "surname_postal": "",
54
+ "street_postal": "",
55
+ "city_postal": "",
56
+ "state_postal": "",
57
+ "zip_postal": "",
58
+ "country_id_postal": "",
59
+ "company_postal": "",
60
+ "company_yn": false,
61
+ "company": "",
62
+ "ico": "",
63
+ "dic": "",
64
+ "vat_payer_yn": false,
65
+ "customer_note": "",
66
+ "agreements": [
67
+ {
68
+ "name": "",
69
+ "valid_to": "",
70
+ "status": false
71
+ }
72
+ ]
73
+ },
74
+ "products": [
75
+ {
76
+ "product_id": 0,
77
+ "option_set_id": 0,
78
+ "code": "",
79
+ "code_supplier": "",
80
+ "supplier": "",
81
+ "ean": "",
82
+ "title": "",
83
+ "adult_yn": false,
84
+ "quantity": 0,
85
+ "unit": "",
86
+ "length": "",
87
+ "length_unit": "",
88
+ "price_per_unit": 0,
89
+ "price": 0,
90
+ "price_with_vat": 0,
91
+ "price_without_vat": 0,
92
+ "vat": 0,
93
+ "buy_price": 0,
94
+ "recycling_fee": 0,
95
+ "weight": 0,
96
+ "availability": "",
97
+ "invoice_info": "",
98
+ "parameters": [
99
+ {
100
+ "name": "",
101
+ "value": ""
102
+ }
103
+ ],
104
+ "configurations": [
105
+ {
106
+ "name": "",
107
+ "values": [
108
+ {
109
+ "value": "",
110
+ "operation": "",
111
+ "cena": 0
112
+ }
113
+ ]
114
+ }
115
+ ],
116
+ "categories": [
117
+ {
118
+ "category_id": 0,
119
+ "code": ""
120
+ }
121
+ ],
122
+ "image_url": ""
123
+ }
124
+ ],
125
+ "discount_voucher": {
126
+ "code": "",
127
+ "type": "percent",
128
+ "amount": 0,
129
+ "discounts": [
130
+ {
131
+ "price": 0,
132
+ "vat": 0
133
+ }
134
+ ]
135
+ },
136
+ "quantity_discount": {
137
+ "type": "percent",
138
+ "amount": 0,
139
+ "discounts": [
140
+ {
141
+ "price": 0,
142
+ "vat": 0
143
+ }
144
+ ]
145
+ },
146
+ "loyalty_points": {
147
+ "one_point_for": 0,
148
+ "amount": 0,
149
+ "discounts": [
150
+ {
151
+ "price": 0,
152
+ "vat": 0
153
+ }
154
+ ]
155
+ },
156
+ "shipment": {
157
+ "id": 0,
158
+ "code": "",
159
+ "name": "",
160
+ "price": 0,
161
+ "vat": 0,
162
+ "affiliate_id": "",
163
+ "type": "",
164
+ "packeta_carrier_id": 0
165
+ },
166
+ "payment": {
167
+ "id": 0,
168
+ "code": "",
169
+ "name": "",
170
+ "price": 0,
171
+ "vat": 0,
172
+ "eet_yn": false,
173
+ "type": ""
174
+ },
175
+ "metas": [
176
+ {
177
+ "key": "",
178
+ "type": "",
179
+ "value": "",
180
+ "values": [
181
+ {
182
+ "language": "",
183
+ "value": ""
184
+ }
185
+ ]
186
+ }
187
+ ]
188
+ }
189
+ ]
190
+ }
191
+ }
@@ -0,0 +1,11 @@
1
+ {
2
+ "headers": {
3
+ "user": "TestUser"
4
+ },
5
+ "data": [
6
+ {
7
+ "body": "{\"order_number\":\"\",\"case_number\":\"\",\"external_order_number\":\"\",\"language_id\":\"\",\"currency_id\":\"\",\"default_currency_rate\":\"\",\"prices_with_vat_yn\":false,\"status_id\":0,\"status\":\"\",\"paid_date\":\"\",\"tracking_code\":\"\",\"tracking_url\":\"\",\"resolved_yn\":false,\"oss_yn\":false,\"internal_note\":\"\",\"last_update_time\":\"\",\"creation_time\":\"\",\"variable_symbol\":\"\",\"total_weight\":0,\"order_total\":0,\"order_total_before_round\":0,\"order_total_rest\":0,\"invoice_number\":\"\",\"origin\":\"admin\",\"admin_url\":\"\",\"customer\":{\"email\":\"\",\"phone\":\"\",\"code\":\"\",\"customer_id\":0,\"customer_pricelist_id\":\"\",\"pricelist_name\":\"\",\"pricelist_percent\":\"\",\"firstname_invoice\":\"\",\"surname_invoice\":\"\",\"street_invoice\":\"\",\"city_invoice\":\"\",\"state_invoice\":\"\",\"zip_invoice\":\"\",\"country_id_invoice\":\"\",\"postal_yn\":false,\"firstname_postal\":\"\",\"surname_postal\":\"\",\"street_postal\":\"\",\"city_postal\":\"\",\"state_postal\":\"\",\"zip_postal\":\"\",\"country_id_postal\":\"\",\"company_postal\":\"\",\"company_yn\":false,\"company\":\"\",\"ico\":\"\",\"dic\":\"\",\"vat_payer_yn\":false,\"customer_note\":\"\",\"agreements\":[{\"name\":\"\",\"valid_to\":\"\",\"status\":false}]},\"products\":[{\"product_id\":0,\"option_set_id\":0,\"code\":\"\",\"code_supplier\":\"\",\"supplier\":\"\",\"ean\":\"\",\"title\":\"\",\"adult_yn\":false,\"quantity\":0,\"unit\":\"\",\"length\":\"\",\"length_unit\":\"\",\"price_per_unit\":0,\"price\":0,\"price_with_vat\":0,\"price_without_vat\":0,\"vat\":0,\"buy_price\":0,\"recycling_fee\":0,\"weight\":0,\"availability\":\"\",\"invoice_info\":\"\",\"parameters\":[{\"name\":\"\",\"value\":\"\"}],\"configurations\":[{\"name\":\"\",\"values\":[{\"value\":\"\",\"operation\":\"\",\"cena\":0}]}],\"categories\":[{\"category_id\":0,\"code\":\"\"}],\"image_url\":\"\"}],\"discount_voucher\":{\"code\":\"\",\"type\":\"percent\",\"amount\":0,\"discounts\":[{\"price\":0,\"vat\":0}]},\"quantity_discount\":{\"type\":\"percent\",\"amount\":0,\"discounts\":[{\"price\":0,\"vat\":0}]},\"loyalty_points\":{\"one_point_for\":0,\"amount\":0,\"discounts\":[{\"price\":0,\"vat\":0}]},\"shipment\":{\"id\":0,\"code\":\"\",\"name\":\"\",\"price\":0,\"vat\":0,\"affiliate_id\":\"\",\"type\":\"\",\"packeta_carrier_id\":0},\"payment\":{\"id\":0,\"code\":\"\",\"name\":\"\",\"price\":0,\"vat\":0,\"eet_yn\":false,\"type\":\"\"},\"metas\":[{\"key\":\"\",\"type\":\"\",\"value\":\"\",\"values\":[{\"language\":\"\",\"value\":\"\"}]}]}",
8
+ "headers": {}
9
+ }
10
+ ]
11
+ }
@@ -0,0 +1,191 @@
1
+ {
2
+ "http": "GET https://private-anon-903e641b16-upgatesapiv2.apiary-mock.com/api/v2/orders?page=1",
3
+ "code": 200,
4
+ "body": {
5
+ "current_page": 0,
6
+ "current_page_items": 0,
7
+ "number_of_pages": 0,
8
+ "number_of_items": 0,
9
+ "orders": [
10
+ {
11
+ "order_number": "",
12
+ "case_number": "",
13
+ "external_order_number": "",
14
+ "language_id": "",
15
+ "currency_id": "",
16
+ "default_currency_rate": "",
17
+ "prices_with_vat_yn": false,
18
+ "status_id": 0,
19
+ "status": "",
20
+ "paid_date": "",
21
+ "tracking_code": "",
22
+ "tracking_url": "",
23
+ "resolved_yn": false,
24
+ "oss_yn": false,
25
+ "internal_note": "",
26
+ "last_update_time": "",
27
+ "creation_time": "",
28
+ "variable_symbol": "",
29
+ "total_weight": 0,
30
+ "order_total": 0,
31
+ "order_total_before_round": 0,
32
+ "order_total_rest": 0,
33
+ "invoice_number": "",
34
+ "origin": "admin",
35
+ "admin_url": "",
36
+ "customer": {
37
+ "email": "",
38
+ "phone": "",
39
+ "code": "",
40
+ "customer_id": 0,
41
+ "customer_pricelist_id": "",
42
+ "pricelist_name": "",
43
+ "pricelist_percent": "",
44
+ "firstname_invoice": "",
45
+ "surname_invoice": "",
46
+ "street_invoice": "",
47
+ "city_invoice": "",
48
+ "state_invoice": "",
49
+ "zip_invoice": "",
50
+ "country_id_invoice": "",
51
+ "postal_yn": false,
52
+ "firstname_postal": "",
53
+ "surname_postal": "",
54
+ "street_postal": "",
55
+ "city_postal": "",
56
+ "state_postal": "",
57
+ "zip_postal": "",
58
+ "country_id_postal": "",
59
+ "company_postal": "",
60
+ "company_yn": false,
61
+ "company": "",
62
+ "ico": "",
63
+ "dic": "",
64
+ "vat_payer_yn": false,
65
+ "customer_note": "",
66
+ "agreements": [
67
+ {
68
+ "name": "",
69
+ "valid_to": "",
70
+ "status": false
71
+ }
72
+ ]
73
+ },
74
+ "products": [
75
+ {
76
+ "product_id": 0,
77
+ "option_set_id": 0,
78
+ "code": "",
79
+ "code_supplier": "",
80
+ "supplier": "",
81
+ "ean": "",
82
+ "title": "",
83
+ "adult_yn": false,
84
+ "quantity": 0,
85
+ "unit": "",
86
+ "length": "",
87
+ "length_unit": "",
88
+ "price_per_unit": 0,
89
+ "price": 0,
90
+ "price_with_vat": 0,
91
+ "price_without_vat": 0,
92
+ "vat": 0,
93
+ "buy_price": 0,
94
+ "recycling_fee": 0,
95
+ "weight": 0,
96
+ "availability": "",
97
+ "invoice_info": "",
98
+ "parameters": [
99
+ {
100
+ "name": "",
101
+ "value": ""
102
+ }
103
+ ],
104
+ "configurations": [
105
+ {
106
+ "name": "",
107
+ "values": [
108
+ {
109
+ "value": "",
110
+ "operation": "",
111
+ "cena": 0
112
+ }
113
+ ]
114
+ }
115
+ ],
116
+ "categories": [
117
+ {
118
+ "category_id": 0,
119
+ "code": ""
120
+ }
121
+ ],
122
+ "image_url": ""
123
+ }
124
+ ],
125
+ "discount_voucher": {
126
+ "code": "",
127
+ "type": "percent",
128
+ "amount": 0,
129
+ "discounts": [
130
+ {
131
+ "price": 0,
132
+ "vat": 0
133
+ }
134
+ ]
135
+ },
136
+ "quantity_discount": {
137
+ "type": "percent",
138
+ "amount": 0,
139
+ "discounts": [
140
+ {
141
+ "price": 0,
142
+ "vat": 0
143
+ }
144
+ ]
145
+ },
146
+ "loyalty_points": {
147
+ "one_point_for": 0,
148
+ "amount": 0,
149
+ "discounts": [
150
+ {
151
+ "price": 0,
152
+ "vat": 0
153
+ }
154
+ ]
155
+ },
156
+ "shipment": {
157
+ "id": 0,
158
+ "code": "",
159
+ "name": "",
160
+ "price": 0,
161
+ "vat": 0,
162
+ "affiliate_id": "",
163
+ "type": "",
164
+ "packeta_carrier_id": 0
165
+ },
166
+ "payment": {
167
+ "id": 0,
168
+ "code": "",
169
+ "name": "",
170
+ "price": 0,
171
+ "vat": 0,
172
+ "eet_yn": false,
173
+ "type": ""
174
+ },
175
+ "metas": [
176
+ {
177
+ "key": "",
178
+ "type": "",
179
+ "value": "",
180
+ "values": [
181
+ {
182
+ "language": "",
183
+ "value": ""
184
+ }
185
+ ]
186
+ }
187
+ ]
188
+ }
189
+ ]
190
+ }
191
+ }
@@ -0,0 +1,8 @@
1
+ {
2
+ "headers": {
3
+ "user": "TestUser"
4
+ },
5
+ "data": {
6
+ "orderNumber": "20200101"
7
+ }
8
+ }