@orchesty/connector-upgates 1.0.0 → 2.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.
- package/README.md +95 -0
- package/dist/Batch/UpgatesCreateWebhooks.js +1 -0
- package/dist/Connector/UpgatesDeleteWebhooks.js +5 -1
- package/dist/package.json +5 -2
- package/package.json +5 -2
- package/CHANGELOG.md +0 -7
- package/coverage/clover.xml +0 -302
- package/coverage/coverage-final.json +0 -11
- package/coverage/lcov-report/base.css +0 -224
- package/coverage/lcov-report/block-navigation.js +0 -87
- package/coverage/lcov-report/favicon.png +0 -0
- package/coverage/lcov-report/index.html +0 -161
- package/coverage/lcov-report/prettify.css +0 -1
- package/coverage/lcov-report/prettify.js +0 -2
- package/coverage/lcov-report/sort-arrow-sprite.png +0 -0
- package/coverage/lcov-report/sorter.js +0 -210
- package/coverage/lcov-report/src/Batch/UpgatesCreateWebhooks.ts.html +0 -358
- package/coverage/lcov-report/src/Batch/UpgatesGetOrders.ts.html +0 -727
- package/coverage/lcov-report/src/Batch/UpgatesGetProducts.ts.html +0 -733
- package/coverage/lcov-report/src/Batch/index.html +0 -146
- package/coverage/lcov-report/src/Connector/UpgatesDeleteWebhooks.ts.html +0 -370
- package/coverage/lcov-report/src/Connector/UpgatesGetOrderStates.ts.html +0 -190
- package/coverage/lcov-report/src/Connector/UpgatesGetPayments.ts.html +0 -268
- package/coverage/lcov-report/src/Connector/UpgatesGetProductParameters.ts.html +0 -316
- package/coverage/lcov-report/src/Connector/UpgatesGetShipments.ts.html +0 -274
- package/coverage/lcov-report/src/Connector/index.html +0 -176
- package/coverage/lcov-report/src/UpgatesApplication.ts.html +0 -379
- package/coverage/lcov-report/src/index.html +0 -116
- package/coverage/lcov-report/test/dataProvider.ts.html +0 -223
- package/coverage/lcov-report/test/index.html +0 -116
- package/coverage/lcov.info +0 -485
- package/jest.config.js +0 -13
- package/src/Batch/UpgatesCreateWebhooks.ts +0 -91
- package/src/Batch/UpgatesGetOrders.ts +0 -214
- package/src/Batch/UpgatesGetProducts.ts +0 -216
- package/src/Batch/__tests__/Data/UpgatesCreateWebhooks/input.json +0 -6
- package/src/Batch/__tests__/Data/UpgatesCreateWebhooks/mock.json +0 -14
- package/src/Batch/__tests__/Data/UpgatesCreateWebhooks/output.json +0 -6
- package/src/Batch/__tests__/Data/UpgatesGetOrders/input.json +0 -6
- package/src/Batch/__tests__/Data/UpgatesGetOrders/lastRun-input.json +0 -6
- package/src/Batch/__tests__/Data/UpgatesGetOrders/lastRun-mock.json +0 -191
- package/src/Batch/__tests__/Data/UpgatesGetOrders/lastRun-output.json +0 -11
- package/src/Batch/__tests__/Data/UpgatesGetOrders/mock.json +0 -191
- package/src/Batch/__tests__/Data/UpgatesGetOrders/orderNumber-input.json +0 -8
- package/src/Batch/__tests__/Data/UpgatesGetOrders/orderNumber-mock.json +0 -191
- package/src/Batch/__tests__/Data/UpgatesGetOrders/orderNumber-output.json +0 -11
- package/src/Batch/__tests__/Data/UpgatesGetOrders/orderNumbers-input.json +0 -8
- package/src/Batch/__tests__/Data/UpgatesGetOrders/orderNumbers-mock.json +0 -191
- package/src/Batch/__tests__/Data/UpgatesGetOrders/orderNumbers-output.json +0 -11
- package/src/Batch/__tests__/Data/UpgatesGetOrders/output.json +0 -11
- package/src/Batch/__tests__/Data/UpgatesGetProducts/input.json +0 -6
- package/src/Batch/__tests__/Data/UpgatesGetProducts/lastRun-input.json +0 -6
- package/src/Batch/__tests__/Data/UpgatesGetProducts/lastRun-mock.json +0 -147
- package/src/Batch/__tests__/Data/UpgatesGetProducts/lastRun-output.json +0 -11
- package/src/Batch/__tests__/Data/UpgatesGetProducts/mock.json +0 -146
- package/src/Batch/__tests__/Data/UpgatesGetProducts/output.json +0 -11
- package/src/Batch/__tests__/Data/UpgatesGetProducts/productId-input.json +0 -8
- package/src/Batch/__tests__/Data/UpgatesGetProducts/productId-mock.json +0 -146
- package/src/Batch/__tests__/Data/UpgatesGetProducts/productId-output.json +0 -11
- package/src/Batch/__tests__/Data/UpgatesGetProducts/productIds-input.json +0 -8
- package/src/Batch/__tests__/Data/UpgatesGetProducts/productIds-mock.json +0 -146
- package/src/Batch/__tests__/Data/UpgatesGetProducts/productIds-output.json +0 -11
- package/src/Batch/__tests__/UpgatesCreateWebhooks.ts +0 -17
- package/src/Batch/__tests__/UpgatesGetOrders.ts +0 -33
- package/src/Batch/__tests__/UpgatesGetProducts.ts +0 -33
- package/src/Connector/UpgatesDeleteWebhooks.ts +0 -95
- package/src/Connector/UpgatesGetOrderStates.ts +0 -35
- package/src/Connector/UpgatesGetPayments.ts +0 -61
- package/src/Connector/UpgatesGetProductParameters.ts +0 -77
- package/src/Connector/UpgatesGetShipments.ts +0 -63
- package/src/Connector/UpgatesUpdateOrder.ts +0 -73
- package/src/Connector/UpgatesUpdateStock.ts +0 -59
- package/src/Connector/__tests__/Data/UpgatesDeleteWebhooks/input.json +0 -6
- package/src/Connector/__tests__/Data/UpgatesDeleteWebhooks/mock.json +0 -16
- package/src/Connector/__tests__/Data/UpgatesDeleteWebhooks/output.json +0 -6
- package/src/Connector/__tests__/Data/UpgatesGetOrderStates/input.json +0 -6
- package/src/Connector/__tests__/Data/UpgatesGetOrderStates/mock.json +0 -14
- package/src/Connector/__tests__/Data/UpgatesGetOrderStates/output.json +0 -15
- package/src/Connector/__tests__/Data/UpgatesGetPayments/input.json +0 -6
- package/src/Connector/__tests__/Data/UpgatesGetPayments/mock.json +0 -42
- package/src/Connector/__tests__/Data/UpgatesGetPayments/output.json +0 -43
- package/src/Connector/__tests__/Data/UpgatesGetProductParameters/both-input.json +0 -9
- package/src/Connector/__tests__/Data/UpgatesGetProductParameters/both-mock.json +0 -108
- package/src/Connector/__tests__/Data/UpgatesGetProductParameters/both-output.json +0 -109
- package/src/Connector/__tests__/Data/UpgatesGetProductParameters/input.json +0 -8
- package/src/Connector/__tests__/Data/UpgatesGetProductParameters/mock.json +0 -108
- package/src/Connector/__tests__/Data/UpgatesGetProductParameters/none-input.json +0 -6
- package/src/Connector/__tests__/Data/UpgatesGetProductParameters/none-mock.json +0 -5
- package/src/Connector/__tests__/Data/UpgatesGetProductParameters/none-output.json +0 -6
- package/src/Connector/__tests__/Data/UpgatesGetProductParameters/output.json +0 -109
- package/src/Connector/__tests__/Data/UpgatesGetShipments/input.json +0 -6
- package/src/Connector/__tests__/Data/UpgatesGetShipments/mock.json +0 -58
- package/src/Connector/__tests__/Data/UpgatesGetShipments/output.json +0 -59
- package/src/Connector/__tests__/UpgatesDeleteWebhooks.ts +0 -61
- package/src/Connector/__tests__/UpgatesGetOrderStates.ts +0 -18
- package/src/Connector/__tests__/UpgatesGetPayments.ts +0 -18
- package/src/Connector/__tests__/UpgatesGetProductParameters.ts +0 -28
- package/src/Connector/__tests__/UpgatesGetShipments.ts +0 -18
- package/src/UpgatesApplication.ts +0 -98
- package/test/dataProvider.ts +0 -46
- package/tsconfig.json +0 -8
- package/tsconfig.prod.json +0 -13
- package/tsconfig.prod.tsbuildinfo +0 -1
|
@@ -1,214 +0,0 @@
|
|
|
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, { NAME as BASE_NAME } from '../UpgatesApplication';
|
|
6
|
-
|
|
7
|
-
export const NAME = `${BASE_NAME.toLowerCase()}-get-orders`;
|
|
8
|
-
|
|
9
|
-
const LIST_PAGE_ENDPOINT = 'api/v2/orders';
|
|
10
|
-
|
|
11
|
-
export default class UpgatesGetOrders 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, orderNumber, orderNumbers } = dto.getJsonData();
|
|
22
|
-
const pageNumber = dto.getBatchCursor('1');
|
|
23
|
-
|
|
24
|
-
let url: string;
|
|
25
|
-
|
|
26
|
-
if (orderNumbers) {
|
|
27
|
-
url = `${LIST_PAGE_ENDPOINT}?order_numbers=${orderNumbers}`;
|
|
28
|
-
} else if (orderNumber) {
|
|
29
|
-
url = `${LIST_PAGE_ENDPOINT}/${orderNumber}`;
|
|
30
|
-
} else {
|
|
31
|
-
url = `${LIST_PAGE_ENDPOINT}?page=${pageNumber}`;
|
|
32
|
-
|
|
33
|
-
const lastRun = from ?? app.getIsoDateFromDate(appInstall.getNonEncryptedSettings().orderLastRun);
|
|
34
|
-
if (lastRun) {
|
|
35
|
-
url = `${url}&creation_time_from=${lastRun}`;
|
|
36
|
-
}
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
const requestDto = app.getRequestDto(dto, appInstall, HttpMethods.GET, url);
|
|
40
|
-
const res = await this.getSender().send<IResponseJson>(requestDto);
|
|
41
|
-
|
|
42
|
-
const {
|
|
43
|
-
|
|
44
|
-
number_of_pages,
|
|
45
|
-
orders,
|
|
46
|
-
} = res.getJsonBody();
|
|
47
|
-
|
|
48
|
-
if (Number(pageNumber) < number_of_pages) {
|
|
49
|
-
dto.setBatchCursor((Number(pageNumber) + 1).toString());
|
|
50
|
-
} else if (!orderNumber) {
|
|
51
|
-
appInstall.setNonEncryptedSettings({ orderLastRun: DateTime.now() });
|
|
52
|
-
const repo = this.getDbClient().getApplicationRepository();
|
|
53
|
-
await repo.update(appInstall);
|
|
54
|
-
}
|
|
55
|
-
dto.setItemList(orders);
|
|
56
|
-
|
|
57
|
-
return dto;
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
export interface IInput {
|
|
63
|
-
from?: string;
|
|
64
|
-
orderNumber?: string;
|
|
65
|
-
orderNumbers?: string;
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
/* eslint-disable @typescript-eslint/naming-convention */
|
|
69
|
-
interface IResponseJson extends IOrderJson {
|
|
70
|
-
number_of_pages: number;
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
interface IOrderJson {
|
|
74
|
-
orders: IOrder[];
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
export interface IOrder {
|
|
78
|
-
order_number: string;
|
|
79
|
-
external_order_number: string;
|
|
80
|
-
language_id: string;
|
|
81
|
-
prices_with_vat_yn: string;
|
|
82
|
-
status_id: string;
|
|
83
|
-
currency_id: string;
|
|
84
|
-
status: string;
|
|
85
|
-
paid_date: string;
|
|
86
|
-
tracking_code: string;
|
|
87
|
-
resolved_yn: string;
|
|
88
|
-
internal_note: string;
|
|
89
|
-
last_update_time: string;
|
|
90
|
-
creation_time: string;
|
|
91
|
-
variable_symbol: string;
|
|
92
|
-
total_weight: string;
|
|
93
|
-
order_total: string;
|
|
94
|
-
order_total_before_round: string;
|
|
95
|
-
order_total_rest: string;
|
|
96
|
-
invoice_number: string;
|
|
97
|
-
origin: string;
|
|
98
|
-
customer: {
|
|
99
|
-
email: string;
|
|
100
|
-
phone: string;
|
|
101
|
-
firstname_invoice: string;
|
|
102
|
-
surname_invoice: string;
|
|
103
|
-
street_invoice: string;
|
|
104
|
-
city_invoice: string;
|
|
105
|
-
state_invoice: string;
|
|
106
|
-
zip_invoice: string;
|
|
107
|
-
country_id_invoice: string;
|
|
108
|
-
postal_yn: string;
|
|
109
|
-
firstname_postal: string;
|
|
110
|
-
surname_postal: string;
|
|
111
|
-
street_postal: string;
|
|
112
|
-
city_postal: string;
|
|
113
|
-
state_postal: string;
|
|
114
|
-
zip_postal: string;
|
|
115
|
-
country_id_postal: string;
|
|
116
|
-
company_postal: string;
|
|
117
|
-
company_yn: string;
|
|
118
|
-
company: string;
|
|
119
|
-
ico: string;
|
|
120
|
-
dic: string;
|
|
121
|
-
vat_payer_yn: string;
|
|
122
|
-
customer_note: string;
|
|
123
|
-
agreements: {
|
|
124
|
-
name: string;
|
|
125
|
-
valid_to: string;
|
|
126
|
-
status: string;
|
|
127
|
-
}[];
|
|
128
|
-
};
|
|
129
|
-
products: {
|
|
130
|
-
product_id: string;
|
|
131
|
-
option_set_id: string;
|
|
132
|
-
code: string;
|
|
133
|
-
code_supplier: string;
|
|
134
|
-
ean: string;
|
|
135
|
-
title: string;
|
|
136
|
-
unit: string;
|
|
137
|
-
quantity: string;
|
|
138
|
-
price_per_unit: string;
|
|
139
|
-
price: string;
|
|
140
|
-
price_with_vat: string;
|
|
141
|
-
price_without_vat: string;
|
|
142
|
-
vat: string;
|
|
143
|
-
buy_price: string;
|
|
144
|
-
weight: string;
|
|
145
|
-
invoice_info: string;
|
|
146
|
-
parameters: {
|
|
147
|
-
name: string;
|
|
148
|
-
value: string;
|
|
149
|
-
}[];
|
|
150
|
-
configurations: {
|
|
151
|
-
name: string;
|
|
152
|
-
values: {
|
|
153
|
-
value: string;
|
|
154
|
-
operation: string;
|
|
155
|
-
price: string;
|
|
156
|
-
}[];
|
|
157
|
-
}[];
|
|
158
|
-
}[];
|
|
159
|
-
discount_voucher: {
|
|
160
|
-
code: string;
|
|
161
|
-
type: string;
|
|
162
|
-
amount: string;
|
|
163
|
-
discounts: {
|
|
164
|
-
vat: string;
|
|
165
|
-
price: string;
|
|
166
|
-
}[];
|
|
167
|
-
};
|
|
168
|
-
quantity_discount: {
|
|
169
|
-
type: string;
|
|
170
|
-
amount: string;
|
|
171
|
-
discounts: {
|
|
172
|
-
vat: string;
|
|
173
|
-
price: string;
|
|
174
|
-
}[];
|
|
175
|
-
};
|
|
176
|
-
loyalty_points: {
|
|
177
|
-
one_point_for: string;
|
|
178
|
-
amount: string;
|
|
179
|
-
discounts: {
|
|
180
|
-
vat: string;
|
|
181
|
-
price: string;
|
|
182
|
-
}[];
|
|
183
|
-
};
|
|
184
|
-
shipment: {
|
|
185
|
-
id: number;
|
|
186
|
-
code: string;
|
|
187
|
-
name: string;
|
|
188
|
-
price: string;
|
|
189
|
-
vat: string;
|
|
190
|
-
affiliate_id: string;
|
|
191
|
-
affiliate_name: string;
|
|
192
|
-
};
|
|
193
|
-
payment: {
|
|
194
|
-
id: number;
|
|
195
|
-
code: string;
|
|
196
|
-
name: string;
|
|
197
|
-
price: string;
|
|
198
|
-
vat: string;
|
|
199
|
-
eet_yn: string;
|
|
200
|
-
};
|
|
201
|
-
metas: {
|
|
202
|
-
key: string;
|
|
203
|
-
type: string;
|
|
204
|
-
value: string;
|
|
205
|
-
values: {
|
|
206
|
-
cs: {
|
|
207
|
-
language: string;
|
|
208
|
-
value: string;
|
|
209
|
-
};
|
|
210
|
-
};
|
|
211
|
-
}[];
|
|
212
|
-
}
|
|
213
|
-
|
|
214
|
-
/* eslint-enable @typescript-eslint/naming-convention */
|
|
@@ -1,216 +0,0 @@
|
|
|
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
|
-
}
|
|
@@ -1,191 +0,0 @@
|
|
|
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
|
-
}
|
|
@@ -1,11 +0,0 @@
|
|
|
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
|
-
}
|