repzo 1.0.1 → 1.0.4
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 +19 -0
- package/package.json +34 -25
- package/src/index.ts +1412 -0
- package/src/types/index.ts +3491 -0
- package/test.ts +2 -1
- package/tsconfig.json +17 -0
- package/index.ts +0 -136
- package/types/index.ts +0 -276
|
@@ -0,0 +1,3491 @@
|
|
|
1
|
+
export interface Params {
|
|
2
|
+
[key: string]: any;
|
|
3
|
+
}
|
|
4
|
+
|
|
5
|
+
export interface Data {
|
|
6
|
+
[key: string]: any;
|
|
7
|
+
}
|
|
8
|
+
export interface Options {
|
|
9
|
+
env?: "staging" | "local" | "production";
|
|
10
|
+
headers?: { [key: string]: string };
|
|
11
|
+
}
|
|
12
|
+
export interface Headers {
|
|
13
|
+
"api-key": string;
|
|
14
|
+
"Content-Type": string;
|
|
15
|
+
Accept: string;
|
|
16
|
+
[key: string]: string;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
interface AdminCreator {
|
|
20
|
+
_id: string;
|
|
21
|
+
type: "admin";
|
|
22
|
+
name?: string;
|
|
23
|
+
admin?: string;
|
|
24
|
+
}
|
|
25
|
+
interface RepCreator {
|
|
26
|
+
_id: string;
|
|
27
|
+
type: "rep";
|
|
28
|
+
name?: string;
|
|
29
|
+
rep?: string;
|
|
30
|
+
}
|
|
31
|
+
interface ClientCreator {
|
|
32
|
+
_id: string;
|
|
33
|
+
type: "client";
|
|
34
|
+
name?: string;
|
|
35
|
+
client?: string;
|
|
36
|
+
}
|
|
37
|
+
interface SerialNumber {
|
|
38
|
+
identifier: string;
|
|
39
|
+
formatted: string;
|
|
40
|
+
count: number;
|
|
41
|
+
}
|
|
42
|
+
interface PaymentData {
|
|
43
|
+
payment_serial_number?: SerialNumber;
|
|
44
|
+
payment_id?: string;
|
|
45
|
+
invoice_serial_number?: SerialNumber;
|
|
46
|
+
return_serial_number?: SerialNumber;
|
|
47
|
+
fullinvoice_id?: string;
|
|
48
|
+
refund_serial_number?: SerialNumber;
|
|
49
|
+
refund_id?: string;
|
|
50
|
+
adjustment_serial_number?: SerialNumber;
|
|
51
|
+
adjustment_id?: string;
|
|
52
|
+
adjustment_account_id?: string;
|
|
53
|
+
view_serial_number?: SerialNumber;
|
|
54
|
+
type?: "invoice" | "payment" | "return_invoice" | "refund" | "adjustment";
|
|
55
|
+
amount: number;
|
|
56
|
+
is_linked_txn?: boolean;
|
|
57
|
+
}
|
|
58
|
+
interface Check {
|
|
59
|
+
_id: string;
|
|
60
|
+
drawer_name: string;
|
|
61
|
+
bank: string;
|
|
62
|
+
bank_branch: string;
|
|
63
|
+
check_number: number;
|
|
64
|
+
check_date: string;
|
|
65
|
+
photo?: string;
|
|
66
|
+
caption?: string;
|
|
67
|
+
photo_meta?: {
|
|
68
|
+
device_orientation?: number;
|
|
69
|
+
height?: number;
|
|
70
|
+
width?: number;
|
|
71
|
+
};
|
|
72
|
+
disabled?: boolean;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
export interface DefaultPaginationQueryParams {
|
|
76
|
+
per_page?: number;
|
|
77
|
+
page?: number;
|
|
78
|
+
sort?: string;
|
|
79
|
+
sortPageOrder?: "asc" | "dsc";
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
export interface DefaultPaginationResult {
|
|
83
|
+
total_result: number;
|
|
84
|
+
current_count: number;
|
|
85
|
+
total_pages: number;
|
|
86
|
+
current_page: number;
|
|
87
|
+
per_page: number;
|
|
88
|
+
first_page_url: string;
|
|
89
|
+
last_page_url: string;
|
|
90
|
+
next_page_url: string | null;
|
|
91
|
+
prev_page_url: string | null;
|
|
92
|
+
path: string;
|
|
93
|
+
data: any[];
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
// <reference path = "vehicle.ts" />
|
|
97
|
+
export namespace Service {
|
|
98
|
+
export namespace Client {
|
|
99
|
+
interface Financials {
|
|
100
|
+
credit_limit?: number;
|
|
101
|
+
}
|
|
102
|
+
type JobType = 0 | 1 | 2 | 3 | 4 | 5 | 6;
|
|
103
|
+
interface JobObject {
|
|
104
|
+
type: JobType[];
|
|
105
|
+
description: string;
|
|
106
|
+
tag: string;
|
|
107
|
+
product_id?: string;
|
|
108
|
+
form_id?: string;
|
|
109
|
+
is_required?: boolean;
|
|
110
|
+
category_id?: string;
|
|
111
|
+
order?: number;
|
|
112
|
+
company_namespace: string[];
|
|
113
|
+
}
|
|
114
|
+
interface ShelfShareTarget {
|
|
115
|
+
msl: string;
|
|
116
|
+
contracted_checkout: number;
|
|
117
|
+
contracted_shelf_length: number;
|
|
118
|
+
total_category_length: number;
|
|
119
|
+
}
|
|
120
|
+
interface RepTarget {
|
|
121
|
+
rep: string;
|
|
122
|
+
target: number;
|
|
123
|
+
classification: string;
|
|
124
|
+
}
|
|
125
|
+
export interface ClientSchema {
|
|
126
|
+
_id: string;
|
|
127
|
+
local_name?: string;
|
|
128
|
+
tags?: string[];
|
|
129
|
+
cell_phone?: string;
|
|
130
|
+
city?: string;
|
|
131
|
+
client_code?: string;
|
|
132
|
+
contact_name?: string;
|
|
133
|
+
contact_title?: string;
|
|
134
|
+
country?: string;
|
|
135
|
+
disabled?: boolean;
|
|
136
|
+
formatted_address?: string;
|
|
137
|
+
lat?: number;
|
|
138
|
+
lng?: number;
|
|
139
|
+
location_verified?: boolean;
|
|
140
|
+
name: string;
|
|
141
|
+
phone?: string;
|
|
142
|
+
state?: string;
|
|
143
|
+
zip?: string;
|
|
144
|
+
assigned_to?: string[];
|
|
145
|
+
last_location_update?: number;
|
|
146
|
+
credit_limit?: number;
|
|
147
|
+
tax_number?: string;
|
|
148
|
+
sync_id?: string;
|
|
149
|
+
rep_targets?: RepTarget[];
|
|
150
|
+
shelf_share_targets?: ShelfShareTarget[];
|
|
151
|
+
profile_pic?: string;
|
|
152
|
+
logo?: string;
|
|
153
|
+
website?: string;
|
|
154
|
+
email?: string;
|
|
155
|
+
comment?: string;
|
|
156
|
+
parent_client_id?: string;
|
|
157
|
+
target_visit?: number;
|
|
158
|
+
geofencing_radius?: number;
|
|
159
|
+
price_tag?: string;
|
|
160
|
+
jobs?: JobObject[];
|
|
161
|
+
status?: string;
|
|
162
|
+
job_category?: string[];
|
|
163
|
+
availability_msl?: string[];
|
|
164
|
+
territory?: string;
|
|
165
|
+
sv_priceList?: string;
|
|
166
|
+
assigned_media?: string[];
|
|
167
|
+
assigned_products?: string[];
|
|
168
|
+
assigned_product_groups?: string;
|
|
169
|
+
verifiedUntil?: number;
|
|
170
|
+
financials?: Financials;
|
|
171
|
+
customFields?: { [key: string]: any };
|
|
172
|
+
paymentTerm?: string;
|
|
173
|
+
speciality?: string[];
|
|
174
|
+
company_namespace: string[];
|
|
175
|
+
channel?: string;
|
|
176
|
+
isChain?: boolean;
|
|
177
|
+
chain?: string;
|
|
178
|
+
teams?: string[];
|
|
179
|
+
payment_type: "cash" | "credit";
|
|
180
|
+
integration_meta?: { [key: string]: any };
|
|
181
|
+
integrated_client_balance?: number;
|
|
182
|
+
createdAt: string;
|
|
183
|
+
updatedAt: string;
|
|
184
|
+
__v: number;
|
|
185
|
+
}
|
|
186
|
+
interface ClientBody {
|
|
187
|
+
name?: string;
|
|
188
|
+
local_name?: string;
|
|
189
|
+
tags?: string[];
|
|
190
|
+
cell_phone?: string;
|
|
191
|
+
city?: string;
|
|
192
|
+
client_code?: string;
|
|
193
|
+
contact_name?: string;
|
|
194
|
+
contact_title?: string;
|
|
195
|
+
country?: string;
|
|
196
|
+
disabled?: boolean;
|
|
197
|
+
formatted_address?: string;
|
|
198
|
+
lat?: number;
|
|
199
|
+
lng?: number;
|
|
200
|
+
location_verified?: boolean;
|
|
201
|
+
phone?: string;
|
|
202
|
+
state?: string;
|
|
203
|
+
zip?: string;
|
|
204
|
+
assigned_to?: string[];
|
|
205
|
+
last_location_update?: number;
|
|
206
|
+
credit_limit?: number;
|
|
207
|
+
tax_number?: string;
|
|
208
|
+
sync_id?: string;
|
|
209
|
+
rep_targets?: RepTarget[];
|
|
210
|
+
shelf_share_targets?: ShelfShareTarget[];
|
|
211
|
+
profile_pic?: string;
|
|
212
|
+
logo?: string;
|
|
213
|
+
website?: string;
|
|
214
|
+
email?: string;
|
|
215
|
+
comment?: string;
|
|
216
|
+
parent_client_id?: string;
|
|
217
|
+
target_visit?: number;
|
|
218
|
+
geofencing_radius?: number;
|
|
219
|
+
price_tag?: string;
|
|
220
|
+
jobs?: JobObject[];
|
|
221
|
+
status?: string;
|
|
222
|
+
job_category?: string[];
|
|
223
|
+
availability_msl?: string[];
|
|
224
|
+
territory?: string;
|
|
225
|
+
sv_priceList?: string;
|
|
226
|
+
assigned_media?: string[];
|
|
227
|
+
assigned_products?: string[];
|
|
228
|
+
assigned_product_groups?: string;
|
|
229
|
+
verifiedUntil?: number;
|
|
230
|
+
financials?: Financials;
|
|
231
|
+
customFields?: { [key: string]: any };
|
|
232
|
+
paymentTerm?: string;
|
|
233
|
+
speciality?: string[];
|
|
234
|
+
company_namespace?: string[];
|
|
235
|
+
channel?: string;
|
|
236
|
+
isChain?: boolean;
|
|
237
|
+
chain?: string;
|
|
238
|
+
teams?: string[];
|
|
239
|
+
payment_type?: "cash" | "credit";
|
|
240
|
+
integration_meta?: { [key: string]: any };
|
|
241
|
+
integrated_client_balance?: number;
|
|
242
|
+
}
|
|
243
|
+
type PopulatedKeys =
|
|
244
|
+
| "tags"
|
|
245
|
+
| "reps"
|
|
246
|
+
| "assigned_to"
|
|
247
|
+
| "sv_priceList"
|
|
248
|
+
| "paymentTerm"
|
|
249
|
+
| "job_category"
|
|
250
|
+
| "msl"
|
|
251
|
+
| "chain"
|
|
252
|
+
| "channel"
|
|
253
|
+
| "product"
|
|
254
|
+
| "assigned_products"
|
|
255
|
+
| "assigned_product_groups"
|
|
256
|
+
| "speciality"
|
|
257
|
+
| "teams";
|
|
258
|
+
|
|
259
|
+
type ClientSchemaWithPopulatedKeys = ClientSchema & {
|
|
260
|
+
assigned_products?:
|
|
261
|
+
| string[]
|
|
262
|
+
| Pick<Product.ProductSchema, "_id" | "name">[];
|
|
263
|
+
assigned_product_groups?:
|
|
264
|
+
| string
|
|
265
|
+
| Pick<ProductGroup.ProductGroupSchema, "_id" | "name">[];
|
|
266
|
+
teams?: string[] | Pick<Team.TeamSchema, "_id" | "name">[];
|
|
267
|
+
assigned_to?: string[] | Pick<Rep.RepSchema, "_id" | "name">[];
|
|
268
|
+
tags?: string[] | Tag.TagSchema[];
|
|
269
|
+
price_tag?: string | Tag.TagSchema;
|
|
270
|
+
job_category?: string[] | JobCategory.JobCategorySchema[];
|
|
271
|
+
sv_priceList?: string | Pick<PriceList.PriceListSchema, "_id" | "name">[];
|
|
272
|
+
chain?:
|
|
273
|
+
| string
|
|
274
|
+
| Pick<Client.ClientSchema, "_id" | "name" | "client_code">;
|
|
275
|
+
channel?: string | Channel.ChannelSchema;
|
|
276
|
+
};
|
|
277
|
+
|
|
278
|
+
export namespace Find {
|
|
279
|
+
export type Params = DefaultPaginationQueryParams & {
|
|
280
|
+
from_updatedAt?: number;
|
|
281
|
+
to_updatedAt?: number;
|
|
282
|
+
from_createdAt?: number;
|
|
283
|
+
to_createdAt?: number;
|
|
284
|
+
createdAt?: number;
|
|
285
|
+
updatedAt?: number;
|
|
286
|
+
name?: string[] | string;
|
|
287
|
+
search?: string;
|
|
288
|
+
disabled?: boolean;
|
|
289
|
+
active?: boolean;
|
|
290
|
+
tags?: string[] | string;
|
|
291
|
+
_id?: string[] | string;
|
|
292
|
+
assigned_to?: string[] | string;
|
|
293
|
+
availability_msl?: string[] | string;
|
|
294
|
+
status?: string[] | string;
|
|
295
|
+
CLIENT_TAGS?: string[] | string;
|
|
296
|
+
AREA_TAGS?: string[] | string;
|
|
297
|
+
isChain?: boolean;
|
|
298
|
+
chain?: string[] | string;
|
|
299
|
+
channel?: string[] | string;
|
|
300
|
+
city?: string[] | string;
|
|
301
|
+
client_code?: string[] | string;
|
|
302
|
+
country?: string[] | string;
|
|
303
|
+
location_verified?: boolean;
|
|
304
|
+
state?: string[] | string;
|
|
305
|
+
sv_priceList?: string[] | string;
|
|
306
|
+
assigned_media?: string[] | string;
|
|
307
|
+
assigned_products?: string[] | string;
|
|
308
|
+
teams?: string[] | string;
|
|
309
|
+
integrated_client_balance?: number[] | number;
|
|
310
|
+
tax_number?: string[] | string;
|
|
311
|
+
speciality?: string[] | string;
|
|
312
|
+
assigned_product_groups?: string[] | string;
|
|
313
|
+
populatedKeys?: PopulatedKeys[];
|
|
314
|
+
[key: string]: any; // integration_meta. & customFields.
|
|
315
|
+
};
|
|
316
|
+
export interface Result extends DefaultPaginationResult {
|
|
317
|
+
data: ClientSchemaWithPopulatedKeys[];
|
|
318
|
+
}
|
|
319
|
+
}
|
|
320
|
+
|
|
321
|
+
export namespace Get {
|
|
322
|
+
export type ID = string;
|
|
323
|
+
export interface Params {
|
|
324
|
+
populatedKeys?: PopulatedKeys[];
|
|
325
|
+
}
|
|
326
|
+
export type Result = ClientSchemaWithPopulatedKeys;
|
|
327
|
+
}
|
|
328
|
+
|
|
329
|
+
export namespace Create {
|
|
330
|
+
export interface Body extends ClientBody {
|
|
331
|
+
name: string;
|
|
332
|
+
}
|
|
333
|
+
export type Result = ClientSchema;
|
|
334
|
+
}
|
|
335
|
+
|
|
336
|
+
export namespace Update {
|
|
337
|
+
export type ID = string;
|
|
338
|
+
export interface Body extends ClientBody {
|
|
339
|
+
_id?: string;
|
|
340
|
+
createdAt?: string;
|
|
341
|
+
updatedAt?: string;
|
|
342
|
+
__v?: number;
|
|
343
|
+
}
|
|
344
|
+
export type Result = ClientSchema;
|
|
345
|
+
}
|
|
346
|
+
|
|
347
|
+
export namespace Remove {
|
|
348
|
+
export type ID = string;
|
|
349
|
+
export type Result = ClientSchema;
|
|
350
|
+
}
|
|
351
|
+
}
|
|
352
|
+
|
|
353
|
+
export namespace Product {
|
|
354
|
+
export interface ProductSchema {
|
|
355
|
+
_id: string;
|
|
356
|
+
name: string;
|
|
357
|
+
category: string;
|
|
358
|
+
active: boolean;
|
|
359
|
+
company_namespace: string[];
|
|
360
|
+
local_name?: string;
|
|
361
|
+
sku?: string;
|
|
362
|
+
sub_category?: string[];
|
|
363
|
+
assigned_to?: string[];
|
|
364
|
+
auditable?: boolean;
|
|
365
|
+
barcode?: string;
|
|
366
|
+
sv_tax?: string;
|
|
367
|
+
sv_measureUnit?: string;
|
|
368
|
+
description?: string;
|
|
369
|
+
local_description?: string;
|
|
370
|
+
product_img?: string;
|
|
371
|
+
base_price?: string;
|
|
372
|
+
assigned_media?: string[];
|
|
373
|
+
html_description?: string;
|
|
374
|
+
modifiers_group?: string[];
|
|
375
|
+
featured?: boolean;
|
|
376
|
+
brand?: string;
|
|
377
|
+
rsp?: number;
|
|
378
|
+
measureunit_family?: string;
|
|
379
|
+
integration_meta?: { [key: string]: any };
|
|
380
|
+
teams?: string[];
|
|
381
|
+
position?: number;
|
|
382
|
+
product_groups?: string[];
|
|
383
|
+
frozen_pre_sales?: boolean;
|
|
384
|
+
frozen_sales?: boolean;
|
|
385
|
+
createdAt: string;
|
|
386
|
+
updatedAt: string;
|
|
387
|
+
__v: number;
|
|
388
|
+
}
|
|
389
|
+
interface ProductBody {
|
|
390
|
+
name?: string;
|
|
391
|
+
category?: string;
|
|
392
|
+
active?: boolean;
|
|
393
|
+
company_namespace?: string[];
|
|
394
|
+
local_name?: string;
|
|
395
|
+
sku?: string;
|
|
396
|
+
sub_category?: string[];
|
|
397
|
+
assigned_to?: string[];
|
|
398
|
+
auditable?: boolean;
|
|
399
|
+
barcode?: string;
|
|
400
|
+
sv_tax?: string;
|
|
401
|
+
sv_measureUnit?: string;
|
|
402
|
+
description?: string;
|
|
403
|
+
local_description?: string;
|
|
404
|
+
product_img?: string;
|
|
405
|
+
base_price?: string;
|
|
406
|
+
assigned_media?: string[];
|
|
407
|
+
html_description?: string;
|
|
408
|
+
modifiers_group?: string[];
|
|
409
|
+
featured?: boolean;
|
|
410
|
+
brand?: string;
|
|
411
|
+
rsp?: number;
|
|
412
|
+
measureunit_family?: string;
|
|
413
|
+
integration_meta?: { [key: string]: any };
|
|
414
|
+
teams?: string[];
|
|
415
|
+
position?: number;
|
|
416
|
+
product_groups?: string[];
|
|
417
|
+
frozen_pre_sales?: boolean;
|
|
418
|
+
frozen_sales?: boolean;
|
|
419
|
+
variants?: Variant.VariantBody & {
|
|
420
|
+
name: string;
|
|
421
|
+
product: string;
|
|
422
|
+
price: number;
|
|
423
|
+
_id?: string;
|
|
424
|
+
createdAt?: string;
|
|
425
|
+
updatedAt?: string;
|
|
426
|
+
__v?: number;
|
|
427
|
+
};
|
|
428
|
+
}
|
|
429
|
+
|
|
430
|
+
type ProductWithPopulatedKeys = ProductSchema & {
|
|
431
|
+
category: string | Category.CategorySchema;
|
|
432
|
+
sub_category?: string[] | SubCategory.SubCategorySchema[];
|
|
433
|
+
sv_tax?: string | Tax.TaxSchema | Pick<Tax.TaxSchema, "_id" | "name">;
|
|
434
|
+
sv_measureUnit?:
|
|
435
|
+
| string
|
|
436
|
+
| MeasureUnit.MeasureUnitSchema
|
|
437
|
+
| Pick<MeasureUnit.MeasureUnitSchema, "_id" | "name">;
|
|
438
|
+
brand?: string | Brand.BrandSchema;
|
|
439
|
+
measureunit_family?: string | MeasureUnitFamily.MeasureUnitFamilySchema;
|
|
440
|
+
product_groups?:
|
|
441
|
+
| string[]
|
|
442
|
+
| Pick<ProductGroup.ProductGroupSchema, "_id" | "name">[];
|
|
443
|
+
variants?: Variant.VariantSchema[];
|
|
444
|
+
defaultVariant?: Variant.VariantSchema;
|
|
445
|
+
assigned_media?: string | Media.MediaSchema;
|
|
446
|
+
};
|
|
447
|
+
|
|
448
|
+
type PopulatedKeys =
|
|
449
|
+
| "category"
|
|
450
|
+
| "sub_category"
|
|
451
|
+
| "tax"
|
|
452
|
+
| "sv_tax"
|
|
453
|
+
| "media"
|
|
454
|
+
| "measureunit_family"
|
|
455
|
+
| "measureunit"
|
|
456
|
+
| "sv_measureUnit"
|
|
457
|
+
| "brand"
|
|
458
|
+
| "product_groups";
|
|
459
|
+
|
|
460
|
+
export namespace Find {
|
|
461
|
+
export type Params = DefaultPaginationQueryParams & {
|
|
462
|
+
populatedKeys?: PopulatedKeys[];
|
|
463
|
+
_id?: string[] | string;
|
|
464
|
+
category?: string[] | string;
|
|
465
|
+
sub_category?: string[] | string;
|
|
466
|
+
name?: string[] | string;
|
|
467
|
+
search?: string;
|
|
468
|
+
active?: boolean;
|
|
469
|
+
disabled?: boolean;
|
|
470
|
+
sv_measureUnit?: string[] | string;
|
|
471
|
+
base_price?: number[] | number;
|
|
472
|
+
assigned_media?: string[] | string;
|
|
473
|
+
modifiers_group?: string[] | string;
|
|
474
|
+
brand?: string[] | string;
|
|
475
|
+
rsp?: number[] | number;
|
|
476
|
+
measureunit_family?: string[] | string;
|
|
477
|
+
teams?: string[] | string;
|
|
478
|
+
position?: number[] | number;
|
|
479
|
+
product_groups?: string[] | string;
|
|
480
|
+
sv_tax?: string[] | string;
|
|
481
|
+
createdAt?: number;
|
|
482
|
+
from_updatedAt?: number;
|
|
483
|
+
to_updatedAt?: number;
|
|
484
|
+
barcode?: string[] | string;
|
|
485
|
+
sku?: string[] | string;
|
|
486
|
+
local_name?: string[] | string;
|
|
487
|
+
frozen_pre_sales?: boolean;
|
|
488
|
+
frozen_sales?: boolean;
|
|
489
|
+
withMedia?: boolean;
|
|
490
|
+
withDefaultVariant?: boolean;
|
|
491
|
+
withVariants?: boolean;
|
|
492
|
+
[key: string]: any; // integration_meta.
|
|
493
|
+
};
|
|
494
|
+
export interface Result extends DefaultPaginationResult {
|
|
495
|
+
data: ProductWithPopulatedKeys[];
|
|
496
|
+
}
|
|
497
|
+
}
|
|
498
|
+
|
|
499
|
+
export namespace Get {
|
|
500
|
+
export type ID = string;
|
|
501
|
+
export interface Params {
|
|
502
|
+
populatedKeys?: PopulatedKeys[];
|
|
503
|
+
withVariants?: boolean;
|
|
504
|
+
}
|
|
505
|
+
export type Result = ProductWithPopulatedKeys;
|
|
506
|
+
}
|
|
507
|
+
|
|
508
|
+
export namespace Create {
|
|
509
|
+
export interface Body extends ProductBody {
|
|
510
|
+
name: string;
|
|
511
|
+
category: string;
|
|
512
|
+
}
|
|
513
|
+
export type Result = ProductSchema;
|
|
514
|
+
}
|
|
515
|
+
|
|
516
|
+
export namespace Update {
|
|
517
|
+
export type ID = string;
|
|
518
|
+
export interface Body extends ProductBody {
|
|
519
|
+
_id?: string;
|
|
520
|
+
createdAt?: string;
|
|
521
|
+
updatedAt?: string;
|
|
522
|
+
__v?: number;
|
|
523
|
+
}
|
|
524
|
+
export type Result = ProductSchema;
|
|
525
|
+
}
|
|
526
|
+
|
|
527
|
+
export namespace Remove {
|
|
528
|
+
export type ID = string;
|
|
529
|
+
export type Result = ProductSchema;
|
|
530
|
+
}
|
|
531
|
+
}
|
|
532
|
+
|
|
533
|
+
export namespace Variant {
|
|
534
|
+
export interface VariantSchema {
|
|
535
|
+
_id: string;
|
|
536
|
+
name: string;
|
|
537
|
+
product: string | Product.ProductSchema;
|
|
538
|
+
price: number;
|
|
539
|
+
company_namespace: string[];
|
|
540
|
+
disabled?: boolean;
|
|
541
|
+
uuid?: string;
|
|
542
|
+
local_name?: string;
|
|
543
|
+
sku?: string;
|
|
544
|
+
barcode?: string;
|
|
545
|
+
weight?: number;
|
|
546
|
+
length?: number;
|
|
547
|
+
width?: number;
|
|
548
|
+
height?: number;
|
|
549
|
+
position?: number;
|
|
550
|
+
default?: boolean;
|
|
551
|
+
variant_img?: string;
|
|
552
|
+
modifiers_groups?: string[];
|
|
553
|
+
integration_meta?: { [key: string]: any };
|
|
554
|
+
createdAt: string;
|
|
555
|
+
updatedAt: string;
|
|
556
|
+
__v: number;
|
|
557
|
+
}
|
|
558
|
+
export interface VariantBody {
|
|
559
|
+
name?: string;
|
|
560
|
+
product?: string;
|
|
561
|
+
price?: number;
|
|
562
|
+
company_namespace?: string[];
|
|
563
|
+
disabled?: boolean;
|
|
564
|
+
uuid?: string;
|
|
565
|
+
local_name?: string;
|
|
566
|
+
sku?: string;
|
|
567
|
+
barcode?: string;
|
|
568
|
+
weight?: number;
|
|
569
|
+
length?: number;
|
|
570
|
+
width?: number;
|
|
571
|
+
height?: number;
|
|
572
|
+
position?: number;
|
|
573
|
+
default?: boolean;
|
|
574
|
+
variant_img?: string;
|
|
575
|
+
modifiers_groups?: string[];
|
|
576
|
+
integration_meta?: { [key: string]: any };
|
|
577
|
+
}
|
|
578
|
+
type PopulatedKeys = "product";
|
|
579
|
+
|
|
580
|
+
export namespace Find {
|
|
581
|
+
export type Params = DefaultPaginationQueryParams & {
|
|
582
|
+
_id?: string[] | string;
|
|
583
|
+
search?: string;
|
|
584
|
+
name?: string[] | string;
|
|
585
|
+
local_name?: string[] | string;
|
|
586
|
+
disabled?: boolean;
|
|
587
|
+
product?: string[] | string;
|
|
588
|
+
barcode?: string[] | string;
|
|
589
|
+
sku?: string[] | string;
|
|
590
|
+
price?: number[] | number;
|
|
591
|
+
position?: number[] | number;
|
|
592
|
+
createdAt?: number;
|
|
593
|
+
updatedAt?: number;
|
|
594
|
+
default?: boolean;
|
|
595
|
+
category?: string[] | string;
|
|
596
|
+
subCategory?: string[] | string;
|
|
597
|
+
brand?: string[] | string;
|
|
598
|
+
productGroup?: string[] | string;
|
|
599
|
+
teams?: string[] | string;
|
|
600
|
+
withProduct?: boolean;
|
|
601
|
+
[key: string]: any; // integration_meta.
|
|
602
|
+
};
|
|
603
|
+
export interface Result extends DefaultPaginationResult {
|
|
604
|
+
data: VariantSchema[];
|
|
605
|
+
}
|
|
606
|
+
}
|
|
607
|
+
|
|
608
|
+
export namespace Get {
|
|
609
|
+
export type ID = string;
|
|
610
|
+
export interface Params {
|
|
611
|
+
populatedKeys?: PopulatedKeys[];
|
|
612
|
+
}
|
|
613
|
+
export type Result = VariantSchema;
|
|
614
|
+
}
|
|
615
|
+
|
|
616
|
+
export namespace Create {
|
|
617
|
+
export interface Body extends VariantBody {
|
|
618
|
+
name: string;
|
|
619
|
+
product: string;
|
|
620
|
+
price: number;
|
|
621
|
+
}
|
|
622
|
+
export type Result = VariantSchema;
|
|
623
|
+
}
|
|
624
|
+
|
|
625
|
+
export namespace Update {
|
|
626
|
+
export type ID = string;
|
|
627
|
+
export interface Body extends VariantBody {
|
|
628
|
+
_id?: string;
|
|
629
|
+
createdAt?: string;
|
|
630
|
+
updatedAt?: string;
|
|
631
|
+
__v?: number;
|
|
632
|
+
}
|
|
633
|
+
export type Result = VariantSchema;
|
|
634
|
+
}
|
|
635
|
+
|
|
636
|
+
export namespace Remove {
|
|
637
|
+
export type ID = string;
|
|
638
|
+
export type Result = VariantSchema;
|
|
639
|
+
}
|
|
640
|
+
}
|
|
641
|
+
|
|
642
|
+
export namespace Category {
|
|
643
|
+
export interface CategorySchema {
|
|
644
|
+
_id: string;
|
|
645
|
+
type?: "main";
|
|
646
|
+
name: string;
|
|
647
|
+
photo?: string;
|
|
648
|
+
local_name?: string;
|
|
649
|
+
icon?: string;
|
|
650
|
+
disabled?: boolean;
|
|
651
|
+
position?: number;
|
|
652
|
+
integration_meta?: { [key: string]: any };
|
|
653
|
+
company_namespace: string[];
|
|
654
|
+
createdAt: string;
|
|
655
|
+
updatedAt: string;
|
|
656
|
+
__v: number;
|
|
657
|
+
}
|
|
658
|
+
export interface CategoryBody {
|
|
659
|
+
name?: string;
|
|
660
|
+
company_namespace?: string[];
|
|
661
|
+
type?: "main";
|
|
662
|
+
disabled?: boolean;
|
|
663
|
+
photo?: string;
|
|
664
|
+
local_name?: string;
|
|
665
|
+
icon?: string;
|
|
666
|
+
position?: number;
|
|
667
|
+
integration_meta?: { [key: string]: any };
|
|
668
|
+
}
|
|
669
|
+
|
|
670
|
+
export namespace Find {
|
|
671
|
+
export type Params = DefaultPaginationQueryParams & {
|
|
672
|
+
_id?: string[] | string;
|
|
673
|
+
search?: string;
|
|
674
|
+
name?: string[] | string;
|
|
675
|
+
local_name?: string[] | string;
|
|
676
|
+
disabled?: boolean;
|
|
677
|
+
position?: number[] | number;
|
|
678
|
+
createdAt?: number;
|
|
679
|
+
updatedAt?: number;
|
|
680
|
+
withProduct?: boolean;
|
|
681
|
+
hasSubCategory?: boolean;
|
|
682
|
+
isLeaf?: boolean;
|
|
683
|
+
[key: string]: any; // integration_meta.
|
|
684
|
+
};
|
|
685
|
+
export interface Result extends DefaultPaginationResult {
|
|
686
|
+
data: CategorySchema & { hasSubCategory?: boolean; isLeaf?: boolean }[];
|
|
687
|
+
}
|
|
688
|
+
}
|
|
689
|
+
|
|
690
|
+
export namespace Get {
|
|
691
|
+
export type ID = string;
|
|
692
|
+
export type Result = CategorySchema;
|
|
693
|
+
}
|
|
694
|
+
|
|
695
|
+
export namespace Create {
|
|
696
|
+
export interface Body extends CategoryBody {
|
|
697
|
+
name: string;
|
|
698
|
+
}
|
|
699
|
+
export type Result = CategorySchema;
|
|
700
|
+
}
|
|
701
|
+
|
|
702
|
+
export namespace Update {
|
|
703
|
+
export type ID = string;
|
|
704
|
+
export interface Body extends CategoryBody {
|
|
705
|
+
_id?: string;
|
|
706
|
+
createdAt?: string;
|
|
707
|
+
updatedAt?: string;
|
|
708
|
+
__v?: number;
|
|
709
|
+
}
|
|
710
|
+
export type Result = CategorySchema;
|
|
711
|
+
}
|
|
712
|
+
|
|
713
|
+
export namespace Remove {
|
|
714
|
+
export type ID = string;
|
|
715
|
+
export type Result = CategorySchema;
|
|
716
|
+
}
|
|
717
|
+
}
|
|
718
|
+
|
|
719
|
+
export namespace Brand {
|
|
720
|
+
export interface BrandSchema {
|
|
721
|
+
_id: string;
|
|
722
|
+
name: string;
|
|
723
|
+
local_name?: string;
|
|
724
|
+
disabled?: boolean;
|
|
725
|
+
integration_meta?: { [key: string]: any };
|
|
726
|
+
company_namespace: string[];
|
|
727
|
+
createdAt: string;
|
|
728
|
+
updatedAt: string;
|
|
729
|
+
__v: number;
|
|
730
|
+
}
|
|
731
|
+
export interface BrandBody {
|
|
732
|
+
name?: string;
|
|
733
|
+
company_namespace?: string[];
|
|
734
|
+
disabled?: boolean;
|
|
735
|
+
local_name?: string;
|
|
736
|
+
integration_meta?: { [key: string]: any };
|
|
737
|
+
}
|
|
738
|
+
|
|
739
|
+
export namespace Find {
|
|
740
|
+
export type Params = DefaultPaginationQueryParams & {
|
|
741
|
+
_id?: string[] | string;
|
|
742
|
+
search?: string;
|
|
743
|
+
name?: string[] | string;
|
|
744
|
+
local_name?: string[] | string;
|
|
745
|
+
disabled?: boolean;
|
|
746
|
+
createdAt?: number;
|
|
747
|
+
updatedAt?: number;
|
|
748
|
+
[key: string]: any; // integration_meta.
|
|
749
|
+
};
|
|
750
|
+
export interface Result extends DefaultPaginationResult {
|
|
751
|
+
data: BrandSchema[];
|
|
752
|
+
}
|
|
753
|
+
}
|
|
754
|
+
|
|
755
|
+
export namespace Get {
|
|
756
|
+
export type ID = string;
|
|
757
|
+
export type Result = BrandSchema;
|
|
758
|
+
}
|
|
759
|
+
|
|
760
|
+
export namespace Create {
|
|
761
|
+
export interface Body extends BrandBody {
|
|
762
|
+
name: string;
|
|
763
|
+
}
|
|
764
|
+
export type Result = BrandSchema;
|
|
765
|
+
}
|
|
766
|
+
|
|
767
|
+
export namespace Update {
|
|
768
|
+
export type ID = string;
|
|
769
|
+
export interface Body extends BrandBody {
|
|
770
|
+
_id?: string;
|
|
771
|
+
createdAt?: string;
|
|
772
|
+
updatedAt?: string;
|
|
773
|
+
__v?: number;
|
|
774
|
+
}
|
|
775
|
+
export type Result = BrandSchema;
|
|
776
|
+
}
|
|
777
|
+
|
|
778
|
+
export namespace Remove {
|
|
779
|
+
export type ID = string;
|
|
780
|
+
export type Result = BrandSchema;
|
|
781
|
+
}
|
|
782
|
+
}
|
|
783
|
+
|
|
784
|
+
export namespace SubCategory {
|
|
785
|
+
export interface SubCategorySchema {
|
|
786
|
+
_id: string;
|
|
787
|
+
name: string;
|
|
788
|
+
parent_id: string | Pick<Category.CategorySchema, "_id" | "name">;
|
|
789
|
+
local_name?: string;
|
|
790
|
+
disabled?: boolean;
|
|
791
|
+
photo?: string;
|
|
792
|
+
position?: number;
|
|
793
|
+
integration_meta?: { [key: string]: any };
|
|
794
|
+
company_namespace: string[];
|
|
795
|
+
createdAt: string;
|
|
796
|
+
updatedAt: string;
|
|
797
|
+
__v: number;
|
|
798
|
+
}
|
|
799
|
+
export interface SubCategoryBody {
|
|
800
|
+
name?: string;
|
|
801
|
+
company_namespace?: string[];
|
|
802
|
+
disabled?: boolean;
|
|
803
|
+
local_name?: string;
|
|
804
|
+
photo?: string;
|
|
805
|
+
position?: number;
|
|
806
|
+
parent_id?: string;
|
|
807
|
+
integration_meta?: { [key: string]: any };
|
|
808
|
+
}
|
|
809
|
+
|
|
810
|
+
type PopulatedKeys = "parent_id";
|
|
811
|
+
|
|
812
|
+
export namespace Find {
|
|
813
|
+
export type Params = DefaultPaginationQueryParams & {
|
|
814
|
+
populatedKeys?: PopulatedKeys[];
|
|
815
|
+
_id?: string[] | string;
|
|
816
|
+
search?: string;
|
|
817
|
+
name?: string[] | string;
|
|
818
|
+
local_name?: string[] | string;
|
|
819
|
+
parent_id?: string[] | string;
|
|
820
|
+
disabled?: boolean;
|
|
821
|
+
position?: number | number[];
|
|
822
|
+
createdAt?: number;
|
|
823
|
+
updatedAt?: number;
|
|
824
|
+
withProduct?: boolean;
|
|
825
|
+
[key: string]: any; // integration_meta.
|
|
826
|
+
};
|
|
827
|
+
export interface Result extends DefaultPaginationResult {
|
|
828
|
+
data: SubCategorySchema[];
|
|
829
|
+
}
|
|
830
|
+
}
|
|
831
|
+
|
|
832
|
+
export namespace Get {
|
|
833
|
+
export type ID = string;
|
|
834
|
+
export interface Params {
|
|
835
|
+
populatedKeys?: PopulatedKeys[];
|
|
836
|
+
}
|
|
837
|
+
export type Result = SubCategorySchema;
|
|
838
|
+
}
|
|
839
|
+
|
|
840
|
+
export namespace Create {
|
|
841
|
+
export interface Body extends SubCategoryBody {
|
|
842
|
+
name: string;
|
|
843
|
+
parent_id: string;
|
|
844
|
+
}
|
|
845
|
+
export type Result = SubCategorySchema;
|
|
846
|
+
}
|
|
847
|
+
|
|
848
|
+
export namespace Update {
|
|
849
|
+
export type ID = string;
|
|
850
|
+
export interface Body extends SubCategoryBody {
|
|
851
|
+
_id?: string;
|
|
852
|
+
createdAt?: string;
|
|
853
|
+
updatedAt?: string;
|
|
854
|
+
__v?: number;
|
|
855
|
+
}
|
|
856
|
+
export type Result = SubCategorySchema;
|
|
857
|
+
}
|
|
858
|
+
|
|
859
|
+
export namespace Remove {
|
|
860
|
+
export type ID = string;
|
|
861
|
+
export type Result = SubCategorySchema;
|
|
862
|
+
}
|
|
863
|
+
}
|
|
864
|
+
|
|
865
|
+
export namespace ProductGroup {
|
|
866
|
+
export interface ProductGroupSchema {
|
|
867
|
+
_id: string;
|
|
868
|
+
name: string;
|
|
869
|
+
local_name?: string;
|
|
870
|
+
disabled?: boolean;
|
|
871
|
+
company_namespace: string[];
|
|
872
|
+
createdAt: string;
|
|
873
|
+
updatedAt: string;
|
|
874
|
+
__v: number;
|
|
875
|
+
}
|
|
876
|
+
export interface ProductGroupBody {
|
|
877
|
+
name?: string;
|
|
878
|
+
company_namespace?: string[];
|
|
879
|
+
disabled?: boolean;
|
|
880
|
+
local_name?: string;
|
|
881
|
+
}
|
|
882
|
+
|
|
883
|
+
export namespace Find {
|
|
884
|
+
export type Params = DefaultPaginationQueryParams & {
|
|
885
|
+
_id?: string[] | string;
|
|
886
|
+
search?: string;
|
|
887
|
+
name?: string[] | string;
|
|
888
|
+
local_name?: string[] | string;
|
|
889
|
+
disabled?: boolean;
|
|
890
|
+
createdAt?: number;
|
|
891
|
+
updatedAt?: number;
|
|
892
|
+
};
|
|
893
|
+
export interface Result extends DefaultPaginationResult {
|
|
894
|
+
data: ProductGroupSchema[];
|
|
895
|
+
}
|
|
896
|
+
}
|
|
897
|
+
|
|
898
|
+
export namespace Get {
|
|
899
|
+
export type ID = string;
|
|
900
|
+
export type Result = ProductGroupSchema;
|
|
901
|
+
}
|
|
902
|
+
|
|
903
|
+
export namespace Create {
|
|
904
|
+
export interface Body extends ProductGroupBody {
|
|
905
|
+
name: string;
|
|
906
|
+
}
|
|
907
|
+
export type Result = ProductGroupSchema;
|
|
908
|
+
}
|
|
909
|
+
|
|
910
|
+
export namespace Update {
|
|
911
|
+
export type ID = string;
|
|
912
|
+
export interface Body extends ProductGroupBody {
|
|
913
|
+
_id?: string;
|
|
914
|
+
createdAt?: string;
|
|
915
|
+
updatedAt?: string;
|
|
916
|
+
__v?: number;
|
|
917
|
+
}
|
|
918
|
+
export type Result = ProductGroupSchema;
|
|
919
|
+
}
|
|
920
|
+
|
|
921
|
+
export namespace Remove {
|
|
922
|
+
export type ID = string;
|
|
923
|
+
export type Result = ProductGroupSchema;
|
|
924
|
+
}
|
|
925
|
+
}
|
|
926
|
+
|
|
927
|
+
export namespace Tax {
|
|
928
|
+
type TaxType = "inclusive" | "additive" | "N/A";
|
|
929
|
+
export interface TaxSchema {
|
|
930
|
+
_id: string;
|
|
931
|
+
name: string;
|
|
932
|
+
rate: number;
|
|
933
|
+
type: TaxType;
|
|
934
|
+
disabled?: boolean;
|
|
935
|
+
integration_meta?: { [key: string]: any };
|
|
936
|
+
company_namespace: string[];
|
|
937
|
+
createdAt: string;
|
|
938
|
+
updatedAt: string;
|
|
939
|
+
__v: number;
|
|
940
|
+
}
|
|
941
|
+
export interface TaxBody {
|
|
942
|
+
name?: string;
|
|
943
|
+
rate?: number;
|
|
944
|
+
type?: TaxType;
|
|
945
|
+
company_namespace?: string[];
|
|
946
|
+
disabled?: boolean;
|
|
947
|
+
integration_meta?: { [key: string]: any };
|
|
948
|
+
}
|
|
949
|
+
|
|
950
|
+
export namespace Find {
|
|
951
|
+
export type Params = DefaultPaginationQueryParams & {
|
|
952
|
+
_id?: string[] | string;
|
|
953
|
+
search?: string;
|
|
954
|
+
name?: string[] | string;
|
|
955
|
+
rate?: number | number[];
|
|
956
|
+
type?: TaxType | TaxType[];
|
|
957
|
+
disabled?: boolean;
|
|
958
|
+
from_updatedAt?: number;
|
|
959
|
+
[key: string]: any; // integration_meta.
|
|
960
|
+
};
|
|
961
|
+
export interface Result extends DefaultPaginationResult {
|
|
962
|
+
data: TaxSchema[];
|
|
963
|
+
}
|
|
964
|
+
}
|
|
965
|
+
|
|
966
|
+
export namespace Get {
|
|
967
|
+
export type ID = string;
|
|
968
|
+
export type Result = TaxSchema;
|
|
969
|
+
}
|
|
970
|
+
|
|
971
|
+
export namespace Create {
|
|
972
|
+
export interface Body extends TaxBody {
|
|
973
|
+
name: string;
|
|
974
|
+
rate: number;
|
|
975
|
+
type: TaxType;
|
|
976
|
+
}
|
|
977
|
+
export type Result = TaxSchema;
|
|
978
|
+
}
|
|
979
|
+
|
|
980
|
+
export namespace Update {
|
|
981
|
+
export type ID = string;
|
|
982
|
+
export interface Body extends TaxBody {
|
|
983
|
+
_id?: string;
|
|
984
|
+
createdAt?: string;
|
|
985
|
+
updatedAt?: string;
|
|
986
|
+
__v?: number;
|
|
987
|
+
}
|
|
988
|
+
export type Result = TaxSchema;
|
|
989
|
+
}
|
|
990
|
+
|
|
991
|
+
export namespace Remove {
|
|
992
|
+
export type ID = string;
|
|
993
|
+
export type Result = TaxSchema;
|
|
994
|
+
}
|
|
995
|
+
}
|
|
996
|
+
|
|
997
|
+
export namespace MeasureUnit {
|
|
998
|
+
export interface MeasureUnitSchema {
|
|
999
|
+
_id: string;
|
|
1000
|
+
name: string;
|
|
1001
|
+
factor: number;
|
|
1002
|
+
local_name?: string;
|
|
1003
|
+
parent?: string;
|
|
1004
|
+
disabled?: boolean;
|
|
1005
|
+
integration_meta?: { [key: string]: any };
|
|
1006
|
+
company_namespace: string[];
|
|
1007
|
+
createdAt: string;
|
|
1008
|
+
updatedAt: string;
|
|
1009
|
+
__v: number;
|
|
1010
|
+
}
|
|
1011
|
+
export interface MeasureUnitBody {
|
|
1012
|
+
name?: string;
|
|
1013
|
+
factor: number;
|
|
1014
|
+
local_name?: string;
|
|
1015
|
+
parent?: string;
|
|
1016
|
+
company_namespace?: string[];
|
|
1017
|
+
disabled?: boolean;
|
|
1018
|
+
integration_meta?: { [key: string]: any };
|
|
1019
|
+
}
|
|
1020
|
+
|
|
1021
|
+
export namespace Find {
|
|
1022
|
+
export type Params = DefaultPaginationQueryParams & {
|
|
1023
|
+
_id?: string[] | string;
|
|
1024
|
+
search?: string;
|
|
1025
|
+
name?: string[] | string;
|
|
1026
|
+
factor?: number | number[];
|
|
1027
|
+
parent?: "nil";
|
|
1028
|
+
disabled?: boolean;
|
|
1029
|
+
from_updatedAt?: number;
|
|
1030
|
+
family_name?: string[] | string;
|
|
1031
|
+
withFamily?: boolean;
|
|
1032
|
+
[key: string]: any; // integration_meta.
|
|
1033
|
+
};
|
|
1034
|
+
export interface Result extends DefaultPaginationResult {
|
|
1035
|
+
data: MeasureUnitSchema &
|
|
1036
|
+
{ family?: MeasureUnitFamily.MeasureUnitFamilySchema[] }[];
|
|
1037
|
+
}
|
|
1038
|
+
}
|
|
1039
|
+
|
|
1040
|
+
export namespace Get {
|
|
1041
|
+
export type ID = string;
|
|
1042
|
+
export type Result = MeasureUnitSchema;
|
|
1043
|
+
}
|
|
1044
|
+
|
|
1045
|
+
export namespace Create {
|
|
1046
|
+
export interface Body extends MeasureUnitBody {
|
|
1047
|
+
name: string;
|
|
1048
|
+
}
|
|
1049
|
+
export type Result = MeasureUnitSchema;
|
|
1050
|
+
}
|
|
1051
|
+
|
|
1052
|
+
export namespace Update {
|
|
1053
|
+
export type ID = string;
|
|
1054
|
+
export interface Body extends MeasureUnitBody {
|
|
1055
|
+
_id?: string;
|
|
1056
|
+
createdAt?: string;
|
|
1057
|
+
updatedAt?: string;
|
|
1058
|
+
__v?: number;
|
|
1059
|
+
}
|
|
1060
|
+
export type Result = MeasureUnitSchema;
|
|
1061
|
+
}
|
|
1062
|
+
|
|
1063
|
+
export namespace Remove {
|
|
1064
|
+
export type ID = string;
|
|
1065
|
+
export type Result = MeasureUnitSchema;
|
|
1066
|
+
}
|
|
1067
|
+
}
|
|
1068
|
+
|
|
1069
|
+
export namespace MeasureUnitFamily {
|
|
1070
|
+
export interface MeasureUnitFamilySchema {
|
|
1071
|
+
_id: string;
|
|
1072
|
+
name: string;
|
|
1073
|
+
local_name?: string;
|
|
1074
|
+
measureunits: string[];
|
|
1075
|
+
disabled?: boolean;
|
|
1076
|
+
integration_meta?: { [key: string]: any };
|
|
1077
|
+
company_namespace: string[];
|
|
1078
|
+
createdAt: string;
|
|
1079
|
+
updatedAt: string;
|
|
1080
|
+
__v: number;
|
|
1081
|
+
}
|
|
1082
|
+
export interface MeasureUnitFamilyBody {
|
|
1083
|
+
name?: string;
|
|
1084
|
+
local_name?: string;
|
|
1085
|
+
measureunits?: string[];
|
|
1086
|
+
company_namespace?: string[];
|
|
1087
|
+
disabled?: boolean;
|
|
1088
|
+
integration_meta?: { [key: string]: any };
|
|
1089
|
+
}
|
|
1090
|
+
|
|
1091
|
+
export namespace Find {
|
|
1092
|
+
export type Params = DefaultPaginationQueryParams & {
|
|
1093
|
+
_id?: string[] | string;
|
|
1094
|
+
search?: string;
|
|
1095
|
+
name?: string[] | string;
|
|
1096
|
+
local_name?: string[] | string;
|
|
1097
|
+
disabled?: boolean;
|
|
1098
|
+
measureunits?: string[] | string;
|
|
1099
|
+
[key: string]: any; // integration_meta.
|
|
1100
|
+
};
|
|
1101
|
+
export interface Result extends DefaultPaginationResult {
|
|
1102
|
+
data: MeasureUnitFamilySchema[];
|
|
1103
|
+
}
|
|
1104
|
+
}
|
|
1105
|
+
|
|
1106
|
+
export namespace Get {
|
|
1107
|
+
export type ID = string;
|
|
1108
|
+
export type Result = MeasureUnitFamilySchema;
|
|
1109
|
+
}
|
|
1110
|
+
|
|
1111
|
+
export namespace Create {
|
|
1112
|
+
export interface Body extends MeasureUnitFamilyBody {
|
|
1113
|
+
name: string;
|
|
1114
|
+
}
|
|
1115
|
+
export type Result = MeasureUnitFamilySchema;
|
|
1116
|
+
}
|
|
1117
|
+
|
|
1118
|
+
export namespace Update {
|
|
1119
|
+
export type ID = string;
|
|
1120
|
+
export interface Body extends MeasureUnitFamilyBody {
|
|
1121
|
+
_id?: string;
|
|
1122
|
+
createdAt?: string;
|
|
1123
|
+
updatedAt?: string;
|
|
1124
|
+
__v?: number;
|
|
1125
|
+
}
|
|
1126
|
+
export type Result = MeasureUnitFamilySchema;
|
|
1127
|
+
}
|
|
1128
|
+
|
|
1129
|
+
export namespace Remove {
|
|
1130
|
+
export type ID = string;
|
|
1131
|
+
export type Result = MeasureUnitFamilySchema;
|
|
1132
|
+
}
|
|
1133
|
+
}
|
|
1134
|
+
|
|
1135
|
+
export namespace Media {
|
|
1136
|
+
type MediaType =
|
|
1137
|
+
| "ppt"
|
|
1138
|
+
| "pptx"
|
|
1139
|
+
| "pdf"
|
|
1140
|
+
| "jpeg"
|
|
1141
|
+
| "jpg"
|
|
1142
|
+
| "png"
|
|
1143
|
+
| "doc"
|
|
1144
|
+
| "docx";
|
|
1145
|
+
export interface MediaSchema {
|
|
1146
|
+
_id: string;
|
|
1147
|
+
name: string;
|
|
1148
|
+
type: MediaType;
|
|
1149
|
+
url: string;
|
|
1150
|
+
creator: AdminCreator | RepCreator;
|
|
1151
|
+
caption?: string;
|
|
1152
|
+
disabled?: boolean;
|
|
1153
|
+
company_namespace: string[];
|
|
1154
|
+
createdAt: string;
|
|
1155
|
+
updatedAt: string;
|
|
1156
|
+
__v: number;
|
|
1157
|
+
}
|
|
1158
|
+
export interface MediaBody {
|
|
1159
|
+
name?: string;
|
|
1160
|
+
type?: MediaType;
|
|
1161
|
+
url?: string[];
|
|
1162
|
+
caption?: string;
|
|
1163
|
+
company_namespace?: string[];
|
|
1164
|
+
disabled?: boolean;
|
|
1165
|
+
}
|
|
1166
|
+
|
|
1167
|
+
export namespace Find {
|
|
1168
|
+
export type Params = DefaultPaginationQueryParams & {
|
|
1169
|
+
_id?: string[] | string;
|
|
1170
|
+
search?: string;
|
|
1171
|
+
name?: string[] | string;
|
|
1172
|
+
"creator._id"?: string[] | string;
|
|
1173
|
+
caption?: string[] | string;
|
|
1174
|
+
url?: string[] | string;
|
|
1175
|
+
type?: MediaType[] | MediaType;
|
|
1176
|
+
disabled?: boolean;
|
|
1177
|
+
repID?: string[] | string;
|
|
1178
|
+
};
|
|
1179
|
+
export interface Result extends DefaultPaginationResult {
|
|
1180
|
+
data: MediaSchema[];
|
|
1181
|
+
}
|
|
1182
|
+
}
|
|
1183
|
+
|
|
1184
|
+
export namespace Get {
|
|
1185
|
+
export type ID = string;
|
|
1186
|
+
export type Result = MediaSchema;
|
|
1187
|
+
}
|
|
1188
|
+
|
|
1189
|
+
export namespace Create {
|
|
1190
|
+
export interface Body extends MediaBody {
|
|
1191
|
+
name: string;
|
|
1192
|
+
}
|
|
1193
|
+
export type Result = MediaSchema;
|
|
1194
|
+
}
|
|
1195
|
+
|
|
1196
|
+
export namespace Update {
|
|
1197
|
+
export type ID = string;
|
|
1198
|
+
export interface Body extends MediaBody {
|
|
1199
|
+
_id?: string;
|
|
1200
|
+
createdAt?: string;
|
|
1201
|
+
updatedAt?: string;
|
|
1202
|
+
__v?: number;
|
|
1203
|
+
}
|
|
1204
|
+
export type Result = MediaSchema;
|
|
1205
|
+
}
|
|
1206
|
+
|
|
1207
|
+
export namespace Remove {
|
|
1208
|
+
export type ID = string;
|
|
1209
|
+
export type Result = string;
|
|
1210
|
+
}
|
|
1211
|
+
}
|
|
1212
|
+
|
|
1213
|
+
export namespace PriceList {
|
|
1214
|
+
interface creator {
|
|
1215
|
+
_id: string;
|
|
1216
|
+
name: string;
|
|
1217
|
+
}
|
|
1218
|
+
export interface PriceListSchema {
|
|
1219
|
+
_id: string;
|
|
1220
|
+
name: string;
|
|
1221
|
+
createdby: creator;
|
|
1222
|
+
disabled?: boolean;
|
|
1223
|
+
integration_meta?: { [key: string]: any };
|
|
1224
|
+
company_namespace: string[];
|
|
1225
|
+
createdAt: string;
|
|
1226
|
+
updatedAt: string;
|
|
1227
|
+
__v: number;
|
|
1228
|
+
}
|
|
1229
|
+
export interface PriceListBody {
|
|
1230
|
+
name?: string;
|
|
1231
|
+
integration_meta?: { [key: string]: any };
|
|
1232
|
+
disabled?: boolean;
|
|
1233
|
+
company_namespace?: string[];
|
|
1234
|
+
}
|
|
1235
|
+
|
|
1236
|
+
export namespace Find {
|
|
1237
|
+
export type Params = DefaultPaginationQueryParams & {
|
|
1238
|
+
_id?: string[] | string;
|
|
1239
|
+
search?: string;
|
|
1240
|
+
name?: string[] | string;
|
|
1241
|
+
"createdby._id"?: string[] | string;
|
|
1242
|
+
disabled?: boolean;
|
|
1243
|
+
from_updatedAt?: number;
|
|
1244
|
+
[key: string]: any; // integration_meta.
|
|
1245
|
+
};
|
|
1246
|
+
export interface Result extends DefaultPaginationResult {
|
|
1247
|
+
data: PriceListSchema[];
|
|
1248
|
+
}
|
|
1249
|
+
}
|
|
1250
|
+
|
|
1251
|
+
export namespace Get {
|
|
1252
|
+
export type ID = string;
|
|
1253
|
+
export type Result = PriceListSchema;
|
|
1254
|
+
}
|
|
1255
|
+
|
|
1256
|
+
export namespace Create {
|
|
1257
|
+
export interface Body extends PriceListBody {
|
|
1258
|
+
name: string;
|
|
1259
|
+
}
|
|
1260
|
+
export type Result = PriceListSchema;
|
|
1261
|
+
}
|
|
1262
|
+
|
|
1263
|
+
export namespace Update {
|
|
1264
|
+
export type ID = string;
|
|
1265
|
+
export interface Body extends PriceListBody {
|
|
1266
|
+
_id?: string;
|
|
1267
|
+
createdAt?: string;
|
|
1268
|
+
updatedAt?: string;
|
|
1269
|
+
__v?: number;
|
|
1270
|
+
}
|
|
1271
|
+
export type Result = PriceListSchema;
|
|
1272
|
+
}
|
|
1273
|
+
|
|
1274
|
+
export namespace Remove {
|
|
1275
|
+
export type ID = string;
|
|
1276
|
+
export type Result = PriceListSchema;
|
|
1277
|
+
}
|
|
1278
|
+
}
|
|
1279
|
+
|
|
1280
|
+
export namespace PriceListItem {
|
|
1281
|
+
export interface PriceListItemSchema {
|
|
1282
|
+
_id: string;
|
|
1283
|
+
product_id: string;
|
|
1284
|
+
variant_id: string;
|
|
1285
|
+
pricelist_id: string;
|
|
1286
|
+
price: number;
|
|
1287
|
+
disabled?: boolean;
|
|
1288
|
+
integration_meta?: { [key: string]: any };
|
|
1289
|
+
company_namespace: string[];
|
|
1290
|
+
createdAt: string;
|
|
1291
|
+
updatedAt: string;
|
|
1292
|
+
__v: number;
|
|
1293
|
+
}
|
|
1294
|
+
export interface PriceListItemBody {
|
|
1295
|
+
product_id?: string;
|
|
1296
|
+
variant_id?: string;
|
|
1297
|
+
pricelist_id?: string;
|
|
1298
|
+
price?: number;
|
|
1299
|
+
integration_meta?: { [key: string]: any };
|
|
1300
|
+
disabled?: boolean;
|
|
1301
|
+
company_namespace?: string[];
|
|
1302
|
+
}
|
|
1303
|
+
|
|
1304
|
+
type PopulatedKeys = "product" | "variant" | "pricelist";
|
|
1305
|
+
|
|
1306
|
+
export namespace Find {
|
|
1307
|
+
export type Params = DefaultPaginationQueryParams & {
|
|
1308
|
+
_id?: string[] | string;
|
|
1309
|
+
search?: string;
|
|
1310
|
+
product_id?: string[] | string;
|
|
1311
|
+
variant_id?: string[] | string;
|
|
1312
|
+
pricelist_id?: string[] | string;
|
|
1313
|
+
disabled?: boolean;
|
|
1314
|
+
from_updatedAt?: number;
|
|
1315
|
+
populatedKeys?: PopulatedKeys[];
|
|
1316
|
+
[key: string]: any; // integration_meta.
|
|
1317
|
+
};
|
|
1318
|
+
export interface Result extends DefaultPaginationResult {
|
|
1319
|
+
data: PriceListItemSchema &
|
|
1320
|
+
{
|
|
1321
|
+
product_id: string | Product.ProductSchema;
|
|
1322
|
+
variant_id: string | Variant.VariantSchema;
|
|
1323
|
+
pricelist_id: string | PriceList.PriceListSchema;
|
|
1324
|
+
}[];
|
|
1325
|
+
}
|
|
1326
|
+
}
|
|
1327
|
+
|
|
1328
|
+
export namespace Get {
|
|
1329
|
+
export type ID = string;
|
|
1330
|
+
export type Result = PriceListItemSchema;
|
|
1331
|
+
}
|
|
1332
|
+
|
|
1333
|
+
export namespace Create {
|
|
1334
|
+
export interface Body extends PriceListItemBody {
|
|
1335
|
+
product_id: string;
|
|
1336
|
+
variant_id: string;
|
|
1337
|
+
pricelist_id: string;
|
|
1338
|
+
price: number;
|
|
1339
|
+
}
|
|
1340
|
+
export type Result = PriceListItemSchema;
|
|
1341
|
+
}
|
|
1342
|
+
|
|
1343
|
+
export namespace Update {
|
|
1344
|
+
export type ID = string;
|
|
1345
|
+
export interface Body extends PriceListItemBody {
|
|
1346
|
+
_id?: string;
|
|
1347
|
+
createdAt?: string;
|
|
1348
|
+
updatedAt?: string;
|
|
1349
|
+
__v?: number;
|
|
1350
|
+
}
|
|
1351
|
+
export type Result = PriceListItemSchema;
|
|
1352
|
+
}
|
|
1353
|
+
|
|
1354
|
+
export namespace Remove {
|
|
1355
|
+
export type ID = string;
|
|
1356
|
+
export type Result = PriceListItemSchema;
|
|
1357
|
+
}
|
|
1358
|
+
}
|
|
1359
|
+
|
|
1360
|
+
export namespace Team {
|
|
1361
|
+
export interface TeamSchema {
|
|
1362
|
+
_id: string;
|
|
1363
|
+
name: string;
|
|
1364
|
+
disabled?: boolean;
|
|
1365
|
+
company_namespace: string[];
|
|
1366
|
+
createdAt: string;
|
|
1367
|
+
updatedAt: string;
|
|
1368
|
+
__v: number;
|
|
1369
|
+
}
|
|
1370
|
+
export interface TeamBody {
|
|
1371
|
+
name?: string;
|
|
1372
|
+
company_namespace?: string[];
|
|
1373
|
+
disabled?: boolean;
|
|
1374
|
+
}
|
|
1375
|
+
|
|
1376
|
+
export namespace Find {
|
|
1377
|
+
export type Params = DefaultPaginationQueryParams & {
|
|
1378
|
+
_id?: string[] | string;
|
|
1379
|
+
search?: string;
|
|
1380
|
+
name?: string[] | string;
|
|
1381
|
+
disabled?: boolean;
|
|
1382
|
+
};
|
|
1383
|
+
export interface Result extends DefaultPaginationResult {
|
|
1384
|
+
data: TeamSchema[];
|
|
1385
|
+
}
|
|
1386
|
+
}
|
|
1387
|
+
|
|
1388
|
+
export namespace Get {
|
|
1389
|
+
export type ID = string;
|
|
1390
|
+
export type Result = TeamSchema & {
|
|
1391
|
+
admins: any; // Admin.Schema
|
|
1392
|
+
reps: any; // Rep.Schema
|
|
1393
|
+
};
|
|
1394
|
+
}
|
|
1395
|
+
|
|
1396
|
+
export namespace Create {
|
|
1397
|
+
export interface Body extends TeamBody {
|
|
1398
|
+
name: string;
|
|
1399
|
+
}
|
|
1400
|
+
export type Result = TeamSchema;
|
|
1401
|
+
}
|
|
1402
|
+
|
|
1403
|
+
export namespace Update {
|
|
1404
|
+
export type ID = string;
|
|
1405
|
+
export interface Body extends TeamBody {
|
|
1406
|
+
_id?: string;
|
|
1407
|
+
createdAt?: string;
|
|
1408
|
+
updatedAt?: string;
|
|
1409
|
+
__v?: number;
|
|
1410
|
+
}
|
|
1411
|
+
export type Result = TeamSchema;
|
|
1412
|
+
}
|
|
1413
|
+
|
|
1414
|
+
export namespace Remove {
|
|
1415
|
+
export type ID = string;
|
|
1416
|
+
export type Result = TeamSchema;
|
|
1417
|
+
}
|
|
1418
|
+
}
|
|
1419
|
+
|
|
1420
|
+
export namespace Rep {
|
|
1421
|
+
interface RepPermissions {
|
|
1422
|
+
rep_can_add_client: boolean;
|
|
1423
|
+
rep_can_edit_client: boolean;
|
|
1424
|
+
rep_can_add_calendar: boolean;
|
|
1425
|
+
rep_can_edit_calendar: boolean;
|
|
1426
|
+
rep_can_skip_photo_tag: boolean;
|
|
1427
|
+
rep_can_edit_product_price?: boolean;
|
|
1428
|
+
rep_must_add_client_with_location?: boolean;
|
|
1429
|
+
rep_can_access_shared_history?: boolean;
|
|
1430
|
+
rep_can_edit_total_shelf_share?: boolean;
|
|
1431
|
+
rep_can_create_transfer?: boolean;
|
|
1432
|
+
rep_can_make_call?: boolean;
|
|
1433
|
+
rep_can_read_stock?: boolean;
|
|
1434
|
+
can_rep_pay_other_reps_invoices?: boolean;
|
|
1435
|
+
rep_can_create_sales_order?: boolean;
|
|
1436
|
+
rep_can_create_invoice?: boolean;
|
|
1437
|
+
rep_can_create_transfer_load?: boolean;
|
|
1438
|
+
rep_can_create_transfer_unload?: boolean;
|
|
1439
|
+
rep_can_create_return_invoice?: boolean;
|
|
1440
|
+
rep_can_sell_zero_product_price?: boolean;
|
|
1441
|
+
}
|
|
1442
|
+
interface TargetResults {
|
|
1443
|
+
totalPoints: number;
|
|
1444
|
+
targetsCount: number;
|
|
1445
|
+
totalAchievements: number;
|
|
1446
|
+
averageAchievements: number;
|
|
1447
|
+
pointsCap: number;
|
|
1448
|
+
}
|
|
1449
|
+
type JobOption = 0 | 1 | 2;
|
|
1450
|
+
export interface RepSchema {
|
|
1451
|
+
_id: string;
|
|
1452
|
+
username: string;
|
|
1453
|
+
name: string;
|
|
1454
|
+
password: string;
|
|
1455
|
+
device_id?: string;
|
|
1456
|
+
linked_to_device?: boolean;
|
|
1457
|
+
live_location?: boolean;
|
|
1458
|
+
phone?: string;
|
|
1459
|
+
integration_id?: string;
|
|
1460
|
+
permissions: RepPermissions;
|
|
1461
|
+
preferences: {
|
|
1462
|
+
isLightModeEnabled?: boolean;
|
|
1463
|
+
};
|
|
1464
|
+
profile_pic?: string;
|
|
1465
|
+
teams?: string[];
|
|
1466
|
+
identifier?: number;
|
|
1467
|
+
notification_id?: string;
|
|
1468
|
+
monthly_sales_target?: number;
|
|
1469
|
+
daily_target_visit?: number;
|
|
1470
|
+
sales_type?: 1 | 2;
|
|
1471
|
+
job_option?: JobOption;
|
|
1472
|
+
msl_sales?: string[];
|
|
1473
|
+
job_category?: string[];
|
|
1474
|
+
assigned_warehouse?: string;
|
|
1475
|
+
assigned_main_warehouse?: string;
|
|
1476
|
+
assigned_plan?: string;
|
|
1477
|
+
integration_meta?: { [key: string]: any };
|
|
1478
|
+
force_online_connectivity?: boolean;
|
|
1479
|
+
assigned_targets?: string[];
|
|
1480
|
+
lines?: string[];
|
|
1481
|
+
targetResults?: TargetResults;
|
|
1482
|
+
previously_assigned_clients?: string[];
|
|
1483
|
+
freshchat_id?: string;
|
|
1484
|
+
disabled?: boolean;
|
|
1485
|
+
company_namespace: string[];
|
|
1486
|
+
createdAt: string;
|
|
1487
|
+
updatedAt: string;
|
|
1488
|
+
__v: number;
|
|
1489
|
+
}
|
|
1490
|
+
export interface RepBody {
|
|
1491
|
+
username?: string;
|
|
1492
|
+
name?: string;
|
|
1493
|
+
password?: string;
|
|
1494
|
+
device_id?: string;
|
|
1495
|
+
linked_to_device?: boolean;
|
|
1496
|
+
live_location?: boolean;
|
|
1497
|
+
phone?: string;
|
|
1498
|
+
integration_id?: string;
|
|
1499
|
+
permissions?: RepPermissions;
|
|
1500
|
+
preferences?: {
|
|
1501
|
+
isLightModeEnabled?: boolean;
|
|
1502
|
+
};
|
|
1503
|
+
profile_pic?: string;
|
|
1504
|
+
teams?: string[];
|
|
1505
|
+
identifier?: number;
|
|
1506
|
+
notification_id?: string;
|
|
1507
|
+
monthly_sales_target?: number;
|
|
1508
|
+
daily_target_visit?: number;
|
|
1509
|
+
sales_type?: 1 | 2;
|
|
1510
|
+
job_option?: JobOption;
|
|
1511
|
+
msl_sales?: string[];
|
|
1512
|
+
job_category?: string[];
|
|
1513
|
+
assigned_warehouse?: string;
|
|
1514
|
+
assigned_main_warehouse?: string;
|
|
1515
|
+
assigned_plan?: string;
|
|
1516
|
+
integration_meta?: { [key: string]: any };
|
|
1517
|
+
force_online_connectivity?: boolean;
|
|
1518
|
+
assigned_targets?: string[];
|
|
1519
|
+
lines?: string[];
|
|
1520
|
+
targetResults?: TargetResults;
|
|
1521
|
+
previously_assigned_clients?: string[];
|
|
1522
|
+
freshchat_id?: string;
|
|
1523
|
+
disabled?: boolean;
|
|
1524
|
+
company_namespace: string[];
|
|
1525
|
+
}
|
|
1526
|
+
|
|
1527
|
+
type PopulatedKeys = "line" | "job_category";
|
|
1528
|
+
|
|
1529
|
+
export type RepWithPopulatedKeysSchema = RepSchema & {
|
|
1530
|
+
lines?: string[] | Line.LineSchema[];
|
|
1531
|
+
job_category?: string[] | JobCategory.JobCategorySchema[];
|
|
1532
|
+
};
|
|
1533
|
+
|
|
1534
|
+
export namespace Find {
|
|
1535
|
+
export type Params = DefaultPaginationQueryParams & {
|
|
1536
|
+
_id?: string[] | string;
|
|
1537
|
+
search?: string;
|
|
1538
|
+
name?: string[] | string;
|
|
1539
|
+
disabled?: boolean;
|
|
1540
|
+
createdAt?: number;
|
|
1541
|
+
updatedAt?: number;
|
|
1542
|
+
username?: string | string[];
|
|
1543
|
+
phone?: string | string[];
|
|
1544
|
+
teams?: string | string[];
|
|
1545
|
+
identifier?: number | number[];
|
|
1546
|
+
msl_sales?: string | string[];
|
|
1547
|
+
job_category?: string | string[];
|
|
1548
|
+
assigned_warehouse?: string | string[];
|
|
1549
|
+
assigned_main_warehouse?: string | string[];
|
|
1550
|
+
assigned_plan?: string | string[];
|
|
1551
|
+
force_online_connectivity?: boolean;
|
|
1552
|
+
assigned_targets?: string | string[];
|
|
1553
|
+
lines?: string | string[];
|
|
1554
|
+
job_option?: JobOption | JobOption[];
|
|
1555
|
+
"permissions.rep_can_add_client"?: boolean;
|
|
1556
|
+
"permissions.rep_can_edit_client"?: boolean;
|
|
1557
|
+
"permissions.rep_can_add_calendar"?: boolean;
|
|
1558
|
+
"permissions.rep_can_edit_calendar"?: boolean;
|
|
1559
|
+
"permissions.rep_can_skip_photo_tag"?: boolean;
|
|
1560
|
+
"permissions.rep_can_edit_product_price"?: boolean;
|
|
1561
|
+
"permissions.rep_must_add_client_with_location"?: boolean;
|
|
1562
|
+
"permissions.rep_can_access_shared_history"?: boolean;
|
|
1563
|
+
"permissions.rep_can_edit_total_shelf_share"?: boolean;
|
|
1564
|
+
"permissions.rep_can_create_transfer"?: boolean;
|
|
1565
|
+
"permissions.rep_can_make_call"?: boolean;
|
|
1566
|
+
"permissions.rep_can_read_stock"?: boolean;
|
|
1567
|
+
"permissions.can_rep_pay_other_reps_invoices"?: boolean;
|
|
1568
|
+
"permissions.rep_can_create_sales_order"?: boolean;
|
|
1569
|
+
"permissions.rep_can_create_invoice"?: boolean;
|
|
1570
|
+
"permissions.rep_can_create_transfer_load"?: boolean;
|
|
1571
|
+
"permissions.rep_can_create_transfer_unload"?: boolean;
|
|
1572
|
+
"permissions.rep_can_create_return_invoice"?: boolean;
|
|
1573
|
+
[key: string]: any; // integration_meta.
|
|
1574
|
+
populatedKeys?: PopulatedKeys[];
|
|
1575
|
+
withProductLines?: boolean;
|
|
1576
|
+
withStatus?: boolean;
|
|
1577
|
+
};
|
|
1578
|
+
export interface Result extends DefaultPaginationResult {
|
|
1579
|
+
data: (RepSchema & {
|
|
1580
|
+
status?:
|
|
1581
|
+
| "Inactive"
|
|
1582
|
+
| "Ended a day"
|
|
1583
|
+
| "Active"
|
|
1584
|
+
| "Visiting"
|
|
1585
|
+
| "Started a day";
|
|
1586
|
+
latest_activity?: string;
|
|
1587
|
+
})[];
|
|
1588
|
+
}
|
|
1589
|
+
}
|
|
1590
|
+
|
|
1591
|
+
export namespace Get {
|
|
1592
|
+
export type ID = string;
|
|
1593
|
+
export interface Params {
|
|
1594
|
+
populatedKeys?: PopulatedKeys[];
|
|
1595
|
+
withProductLines?: boolean;
|
|
1596
|
+
}
|
|
1597
|
+
export type Result = RepSchema;
|
|
1598
|
+
}
|
|
1599
|
+
|
|
1600
|
+
export namespace Create {
|
|
1601
|
+
export interface Body extends RepBody {
|
|
1602
|
+
name: string;
|
|
1603
|
+
username: string;
|
|
1604
|
+
password: string;
|
|
1605
|
+
}
|
|
1606
|
+
export type Result = RepSchema;
|
|
1607
|
+
}
|
|
1608
|
+
|
|
1609
|
+
export namespace Update {
|
|
1610
|
+
export type ID = string;
|
|
1611
|
+
export interface Body extends RepBody {
|
|
1612
|
+
_id?: string;
|
|
1613
|
+
createdAt?: string;
|
|
1614
|
+
updatedAt?: string;
|
|
1615
|
+
__v?: number;
|
|
1616
|
+
}
|
|
1617
|
+
export type Result = RepSchema;
|
|
1618
|
+
}
|
|
1619
|
+
|
|
1620
|
+
export namespace Remove {
|
|
1621
|
+
export type ID = string;
|
|
1622
|
+
export type Result = RepSchema;
|
|
1623
|
+
}
|
|
1624
|
+
}
|
|
1625
|
+
|
|
1626
|
+
export namespace Line {
|
|
1627
|
+
export interface LineSchema {
|
|
1628
|
+
_id: string;
|
|
1629
|
+
name: string;
|
|
1630
|
+
local_name?: string;
|
|
1631
|
+
icon?: string;
|
|
1632
|
+
disabled?: boolean;
|
|
1633
|
+
company_namespace: string[];
|
|
1634
|
+
createdAt: string;
|
|
1635
|
+
updatedAt: string;
|
|
1636
|
+
__v: number;
|
|
1637
|
+
}
|
|
1638
|
+
}
|
|
1639
|
+
|
|
1640
|
+
export namespace JobCategory {
|
|
1641
|
+
interface JobSchema {
|
|
1642
|
+
type: 0 | 1 | 2 | 3 | 4 | 5 | 7 | 8 | 9;
|
|
1643
|
+
description: string;
|
|
1644
|
+
tag?: string | Tag.TagSchema;
|
|
1645
|
+
product_id?: string;
|
|
1646
|
+
form_id?: string;
|
|
1647
|
+
msl_id?: string;
|
|
1648
|
+
is_required: boolean;
|
|
1649
|
+
order: number;
|
|
1650
|
+
}
|
|
1651
|
+
export interface JobCategorySchema {
|
|
1652
|
+
_id: string;
|
|
1653
|
+
en_name: string;
|
|
1654
|
+
ar_name?: string;
|
|
1655
|
+
from_date: number;
|
|
1656
|
+
end_date?: number;
|
|
1657
|
+
description?: string;
|
|
1658
|
+
deleted_at?: number;
|
|
1659
|
+
is_sequence: boolean;
|
|
1660
|
+
jobs: JobSchema[];
|
|
1661
|
+
disabled?: boolean;
|
|
1662
|
+
company_namespace: string[];
|
|
1663
|
+
createdAt: string;
|
|
1664
|
+
updatedAt: string;
|
|
1665
|
+
__v: number;
|
|
1666
|
+
}
|
|
1667
|
+
}
|
|
1668
|
+
|
|
1669
|
+
export namespace Tag {
|
|
1670
|
+
type TagType = "photo" | "client" | "area" | "price";
|
|
1671
|
+
export interface TagSchema {
|
|
1672
|
+
_id: string;
|
|
1673
|
+
type: TagType;
|
|
1674
|
+
tag: string;
|
|
1675
|
+
disabled?: boolean;
|
|
1676
|
+
integration_meta?: { [key: string]: any };
|
|
1677
|
+
company_namespace: string[];
|
|
1678
|
+
createdAt: string;
|
|
1679
|
+
updatedAt: string;
|
|
1680
|
+
__v: number;
|
|
1681
|
+
}
|
|
1682
|
+
export interface TagBody {
|
|
1683
|
+
tag?: string;
|
|
1684
|
+
type?: TagType;
|
|
1685
|
+
disabled?: boolean;
|
|
1686
|
+
integration_meta?: { [key: string]: any };
|
|
1687
|
+
company_namespace?: string[];
|
|
1688
|
+
}
|
|
1689
|
+
|
|
1690
|
+
export namespace Find {
|
|
1691
|
+
export type Params = DefaultPaginationQueryParams & {
|
|
1692
|
+
_id?: string[] | string;
|
|
1693
|
+
search?: string;
|
|
1694
|
+
tag?: string[] | string;
|
|
1695
|
+
type?: TagType[] | TagType;
|
|
1696
|
+
disabled?: boolean;
|
|
1697
|
+
from_updatedAt?: number;
|
|
1698
|
+
[key: string]: any; // integration_meta.
|
|
1699
|
+
};
|
|
1700
|
+
export interface Result extends DefaultPaginationResult {
|
|
1701
|
+
data: TagSchema[];
|
|
1702
|
+
}
|
|
1703
|
+
}
|
|
1704
|
+
|
|
1705
|
+
export namespace Get {
|
|
1706
|
+
export type ID = string;
|
|
1707
|
+
export type Result = TagSchema;
|
|
1708
|
+
}
|
|
1709
|
+
|
|
1710
|
+
export namespace Create {
|
|
1711
|
+
export interface Body extends TagBody {
|
|
1712
|
+
type: TagType;
|
|
1713
|
+
tag: string;
|
|
1714
|
+
}
|
|
1715
|
+
export type Result = TagSchema;
|
|
1716
|
+
}
|
|
1717
|
+
|
|
1718
|
+
export namespace Update {
|
|
1719
|
+
export type ID = string;
|
|
1720
|
+
export interface Body extends TagBody {
|
|
1721
|
+
_id?: string;
|
|
1722
|
+
createdAt?: string;
|
|
1723
|
+
updatedAt?: string;
|
|
1724
|
+
__v?: number;
|
|
1725
|
+
}
|
|
1726
|
+
export type Result = TagSchema;
|
|
1727
|
+
}
|
|
1728
|
+
|
|
1729
|
+
export namespace Remove {
|
|
1730
|
+
export type ID = string;
|
|
1731
|
+
export type Result = TagSchema;
|
|
1732
|
+
}
|
|
1733
|
+
}
|
|
1734
|
+
|
|
1735
|
+
export namespace Warehouse {
|
|
1736
|
+
type WarehouseType = "van" | "main" | "origin";
|
|
1737
|
+
export interface WarehouseSchema {
|
|
1738
|
+
_id: string;
|
|
1739
|
+
type: WarehouseType;
|
|
1740
|
+
name: string;
|
|
1741
|
+
code?: string;
|
|
1742
|
+
disabled?: boolean;
|
|
1743
|
+
integration_meta?: { [key: string]: any };
|
|
1744
|
+
company_namespace: string[];
|
|
1745
|
+
createdAt: string;
|
|
1746
|
+
updatedAt: string;
|
|
1747
|
+
__v: number;
|
|
1748
|
+
}
|
|
1749
|
+
export interface WarehouseBody {
|
|
1750
|
+
name?: string;
|
|
1751
|
+
type?: WarehouseType;
|
|
1752
|
+
code?: string;
|
|
1753
|
+
disabled?: boolean;
|
|
1754
|
+
integration_meta?: { [key: string]: any };
|
|
1755
|
+
company_namespace?: string[];
|
|
1756
|
+
}
|
|
1757
|
+
type PopulatedKeys = "rep_id";
|
|
1758
|
+
export namespace Find {
|
|
1759
|
+
export type Params = DefaultPaginationQueryParams & {
|
|
1760
|
+
_id?: string[] | string;
|
|
1761
|
+
search?: string;
|
|
1762
|
+
name?: string[] | string;
|
|
1763
|
+
code?: string[] | string;
|
|
1764
|
+
type?: WarehouseType[] | WarehouseType;
|
|
1765
|
+
disabled?: boolean;
|
|
1766
|
+
from_updatedAt?: number;
|
|
1767
|
+
[key: string]: any; // integration_meta.
|
|
1768
|
+
populatedKeys?: PopulatedKeys[];
|
|
1769
|
+
};
|
|
1770
|
+
export interface Result extends DefaultPaginationResult {
|
|
1771
|
+
data: (WarehouseSchema & {
|
|
1772
|
+
rep_id?: Pick<Rep.RepSchema, "_id" | "name">;
|
|
1773
|
+
})[];
|
|
1774
|
+
}
|
|
1775
|
+
}
|
|
1776
|
+
|
|
1777
|
+
export namespace Get {
|
|
1778
|
+
export type ID = string;
|
|
1779
|
+
export type Result = WarehouseSchema;
|
|
1780
|
+
}
|
|
1781
|
+
|
|
1782
|
+
export namespace Create {
|
|
1783
|
+
export interface Body extends WarehouseBody {
|
|
1784
|
+
name: string;
|
|
1785
|
+
type: WarehouseType;
|
|
1786
|
+
}
|
|
1787
|
+
export type Result = WarehouseSchema;
|
|
1788
|
+
}
|
|
1789
|
+
|
|
1790
|
+
export namespace Update {
|
|
1791
|
+
export type ID = string;
|
|
1792
|
+
export interface Body extends WarehouseBody {
|
|
1793
|
+
_id?: string;
|
|
1794
|
+
createdAt?: string;
|
|
1795
|
+
updatedAt?: string;
|
|
1796
|
+
__v?: number;
|
|
1797
|
+
}
|
|
1798
|
+
export type Result = WarehouseSchema;
|
|
1799
|
+
}
|
|
1800
|
+
|
|
1801
|
+
export namespace Remove {
|
|
1802
|
+
export type ID = string;
|
|
1803
|
+
export type Result = WarehouseSchema;
|
|
1804
|
+
}
|
|
1805
|
+
}
|
|
1806
|
+
|
|
1807
|
+
export namespace Channel {
|
|
1808
|
+
export interface ChannelSchema {
|
|
1809
|
+
_id: string;
|
|
1810
|
+
name: string;
|
|
1811
|
+
local_name?: string;
|
|
1812
|
+
disabled?: boolean;
|
|
1813
|
+
integration_meta?: { [key: string]: any };
|
|
1814
|
+
company_namespace: string[];
|
|
1815
|
+
createdAt: string;
|
|
1816
|
+
updatedAt: string;
|
|
1817
|
+
__v: number;
|
|
1818
|
+
}
|
|
1819
|
+
export interface ChannelBody {
|
|
1820
|
+
name?: string;
|
|
1821
|
+
local_name?: string;
|
|
1822
|
+
disabled?: boolean;
|
|
1823
|
+
integration_meta?: { [key: string]: any };
|
|
1824
|
+
company_namespace?: string[];
|
|
1825
|
+
}
|
|
1826
|
+
|
|
1827
|
+
export namespace Find {
|
|
1828
|
+
export type Params = DefaultPaginationQueryParams & {
|
|
1829
|
+
_id?: string[] | string;
|
|
1830
|
+
search?: string;
|
|
1831
|
+
name?: string[] | string;
|
|
1832
|
+
local_name?: string[] | string;
|
|
1833
|
+
disabled?: boolean;
|
|
1834
|
+
[key: string]: any; // integration_meta.
|
|
1835
|
+
};
|
|
1836
|
+
export interface Result extends DefaultPaginationResult {
|
|
1837
|
+
data: ChannelSchema[];
|
|
1838
|
+
}
|
|
1839
|
+
}
|
|
1840
|
+
|
|
1841
|
+
export namespace Get {
|
|
1842
|
+
export type ID = string;
|
|
1843
|
+
export type Result = ChannelSchema;
|
|
1844
|
+
}
|
|
1845
|
+
|
|
1846
|
+
export namespace Create {
|
|
1847
|
+
export interface Body extends ChannelBody {
|
|
1848
|
+
name: string;
|
|
1849
|
+
}
|
|
1850
|
+
export type Result = ChannelSchema;
|
|
1851
|
+
}
|
|
1852
|
+
|
|
1853
|
+
export namespace Update {
|
|
1854
|
+
export type ID = string;
|
|
1855
|
+
export interface Body extends ChannelBody {
|
|
1856
|
+
_id?: string;
|
|
1857
|
+
createdAt?: string;
|
|
1858
|
+
updatedAt?: string;
|
|
1859
|
+
__v?: number;
|
|
1860
|
+
}
|
|
1861
|
+
export type Result = ChannelSchema;
|
|
1862
|
+
}
|
|
1863
|
+
|
|
1864
|
+
export namespace Remove {
|
|
1865
|
+
export type ID = string;
|
|
1866
|
+
export type Result = ChannelSchema;
|
|
1867
|
+
}
|
|
1868
|
+
}
|
|
1869
|
+
|
|
1870
|
+
export namespace PaymentTerm {
|
|
1871
|
+
export interface PaymentTermSchema {
|
|
1872
|
+
_id: string;
|
|
1873
|
+
name: string;
|
|
1874
|
+
due_days: number;
|
|
1875
|
+
editor: AdminCreator;
|
|
1876
|
+
disabled?: boolean;
|
|
1877
|
+
integration_meta?: { [key: string]: any };
|
|
1878
|
+
company_namespace: string[];
|
|
1879
|
+
createdAt: string;
|
|
1880
|
+
updatedAt: string;
|
|
1881
|
+
__v: number;
|
|
1882
|
+
}
|
|
1883
|
+
export interface PaymentTermBody {
|
|
1884
|
+
name?: string;
|
|
1885
|
+
due_days?: number;
|
|
1886
|
+
editor?: AdminCreator;
|
|
1887
|
+
disabled?: boolean;
|
|
1888
|
+
integration_meta?: { [key: string]: any };
|
|
1889
|
+
company_namespace?: string[];
|
|
1890
|
+
}
|
|
1891
|
+
|
|
1892
|
+
export namespace Find {
|
|
1893
|
+
export type Params = DefaultPaginationQueryParams & {
|
|
1894
|
+
_id?: string[] | string;
|
|
1895
|
+
search?: string;
|
|
1896
|
+
name?: string[] | string;
|
|
1897
|
+
disabled?: boolean;
|
|
1898
|
+
[key: string]: any; // integration_meta.
|
|
1899
|
+
};
|
|
1900
|
+
export interface Result extends DefaultPaginationResult {
|
|
1901
|
+
data: PaymentTermSchema[];
|
|
1902
|
+
}
|
|
1903
|
+
}
|
|
1904
|
+
|
|
1905
|
+
export namespace Get {
|
|
1906
|
+
export type ID = string;
|
|
1907
|
+
export type Result = PaymentTermSchema;
|
|
1908
|
+
}
|
|
1909
|
+
|
|
1910
|
+
export namespace Create {
|
|
1911
|
+
export interface Body extends PaymentTermBody {
|
|
1912
|
+
name: string;
|
|
1913
|
+
due_days: number;
|
|
1914
|
+
}
|
|
1915
|
+
export type Result = PaymentTermSchema;
|
|
1916
|
+
}
|
|
1917
|
+
|
|
1918
|
+
export namespace Update {
|
|
1919
|
+
export type ID = string;
|
|
1920
|
+
export interface Body extends PaymentTermBody {
|
|
1921
|
+
_id?: string;
|
|
1922
|
+
createdAt?: string;
|
|
1923
|
+
updatedAt?: string;
|
|
1924
|
+
__v?: number;
|
|
1925
|
+
}
|
|
1926
|
+
export type Result = PaymentTermSchema;
|
|
1927
|
+
}
|
|
1928
|
+
|
|
1929
|
+
export namespace Remove {
|
|
1930
|
+
export type ID = string;
|
|
1931
|
+
export type Result = PaymentTermSchema;
|
|
1932
|
+
}
|
|
1933
|
+
}
|
|
1934
|
+
|
|
1935
|
+
export namespace Bank {
|
|
1936
|
+
export interface BankSchema {
|
|
1937
|
+
_id: string;
|
|
1938
|
+
name: string;
|
|
1939
|
+
country?: string[];
|
|
1940
|
+
integration_meta?: { [key: string]: any };
|
|
1941
|
+
company_namespace: string[];
|
|
1942
|
+
createdAt: string;
|
|
1943
|
+
updatedAt: string;
|
|
1944
|
+
__v: number;
|
|
1945
|
+
}
|
|
1946
|
+
export interface BankBody {
|
|
1947
|
+
name?: string;
|
|
1948
|
+
country?: string[];
|
|
1949
|
+
integration_meta?: { [key: string]: any };
|
|
1950
|
+
company_namespace?: string[];
|
|
1951
|
+
}
|
|
1952
|
+
|
|
1953
|
+
export namespace Find {
|
|
1954
|
+
export type Params = DefaultPaginationQueryParams & {
|
|
1955
|
+
_id?: string[] | string;
|
|
1956
|
+
search?: string;
|
|
1957
|
+
[key: string]: any; // integration_meta.
|
|
1958
|
+
};
|
|
1959
|
+
export interface Result extends DefaultPaginationResult {
|
|
1960
|
+
data: BankSchema[];
|
|
1961
|
+
}
|
|
1962
|
+
}
|
|
1963
|
+
|
|
1964
|
+
export namespace Get {
|
|
1965
|
+
export type ID = string;
|
|
1966
|
+
export type Result = BankSchema;
|
|
1967
|
+
}
|
|
1968
|
+
|
|
1969
|
+
export namespace Create {
|
|
1970
|
+
export interface Body extends BankBody {
|
|
1971
|
+
name: string;
|
|
1972
|
+
}
|
|
1973
|
+
export type Result = BankSchema;
|
|
1974
|
+
}
|
|
1975
|
+
|
|
1976
|
+
export namespace Update {
|
|
1977
|
+
export type ID = string;
|
|
1978
|
+
export interface Body extends BankBody {
|
|
1979
|
+
_id?: string;
|
|
1980
|
+
createdAt?: string;
|
|
1981
|
+
updatedAt?: string;
|
|
1982
|
+
__v?: number;
|
|
1983
|
+
}
|
|
1984
|
+
export type Result = BankSchema;
|
|
1985
|
+
}
|
|
1986
|
+
}
|
|
1987
|
+
|
|
1988
|
+
export namespace CustomStatus {
|
|
1989
|
+
type CustomStatusModel =
|
|
1990
|
+
| "proformas"
|
|
1991
|
+
| "fullinvoices"
|
|
1992
|
+
| "transfers"
|
|
1993
|
+
| "payments";
|
|
1994
|
+
export interface CustomStatusSchema {
|
|
1995
|
+
_id: string;
|
|
1996
|
+
name: string;
|
|
1997
|
+
code: string;
|
|
1998
|
+
model: CustomStatusModel;
|
|
1999
|
+
local_name?: string;
|
|
2000
|
+
is_default: boolean;
|
|
2001
|
+
color?: string;
|
|
2002
|
+
disabled?: boolean;
|
|
2003
|
+
company_namespace: string[];
|
|
2004
|
+
createdAt: string;
|
|
2005
|
+
updatedAt: string;
|
|
2006
|
+
__v: number;
|
|
2007
|
+
}
|
|
2008
|
+
export interface CustomStatusBody {
|
|
2009
|
+
name?: string;
|
|
2010
|
+
code: string;
|
|
2011
|
+
model: CustomStatusModel;
|
|
2012
|
+
local_name?: string;
|
|
2013
|
+
is_default: boolean;
|
|
2014
|
+
color?: string;
|
|
2015
|
+
company_namespace?: string[];
|
|
2016
|
+
disabled?: boolean;
|
|
2017
|
+
}
|
|
2018
|
+
|
|
2019
|
+
export namespace Find {
|
|
2020
|
+
export type Params = DefaultPaginationQueryParams & {
|
|
2021
|
+
_id?: string[] | string;
|
|
2022
|
+
search?: string;
|
|
2023
|
+
name?: string[] | string;
|
|
2024
|
+
code?: string[] | string;
|
|
2025
|
+
model?: CustomStatusModel | CustomStatusModel[];
|
|
2026
|
+
is_default?: boolean;
|
|
2027
|
+
color?: string[] | string;
|
|
2028
|
+
disabled?: boolean;
|
|
2029
|
+
[key: string]: any; // integration_meta.
|
|
2030
|
+
};
|
|
2031
|
+
export interface Result extends DefaultPaginationResult {
|
|
2032
|
+
data: CustomStatusSchema[];
|
|
2033
|
+
}
|
|
2034
|
+
}
|
|
2035
|
+
|
|
2036
|
+
export namespace Get {
|
|
2037
|
+
export type ID = string;
|
|
2038
|
+
export type Result = CustomStatusSchema;
|
|
2039
|
+
}
|
|
2040
|
+
|
|
2041
|
+
export namespace Create {
|
|
2042
|
+
export interface Body extends CustomStatusBody {
|
|
2043
|
+
name: string;
|
|
2044
|
+
model: CustomStatusModel;
|
|
2045
|
+
}
|
|
2046
|
+
export type Result = CustomStatusSchema;
|
|
2047
|
+
}
|
|
2048
|
+
|
|
2049
|
+
export namespace Update {
|
|
2050
|
+
export type ID = string;
|
|
2051
|
+
export interface Body extends CustomStatusBody {
|
|
2052
|
+
_id?: string;
|
|
2053
|
+
createdAt?: string;
|
|
2054
|
+
updatedAt?: string;
|
|
2055
|
+
__v?: number;
|
|
2056
|
+
}
|
|
2057
|
+
export type Result = CustomStatusSchema;
|
|
2058
|
+
}
|
|
2059
|
+
|
|
2060
|
+
export namespace Remove {
|
|
2061
|
+
export type ID = string;
|
|
2062
|
+
export type Result = CustomStatusSchema;
|
|
2063
|
+
}
|
|
2064
|
+
}
|
|
2065
|
+
export namespace Promotion {
|
|
2066
|
+
interface CompoundSchema {
|
|
2067
|
+
manual_allocation?: boolean;
|
|
2068
|
+
appliedCount: number;
|
|
2069
|
+
sorting: "cheapest" | "expensive";
|
|
2070
|
+
enforcement_mode:
|
|
2071
|
+
| "all_in_inventory"
|
|
2072
|
+
| "all"
|
|
2073
|
+
| "gift_in_inventory"
|
|
2074
|
+
| "gift";
|
|
2075
|
+
calculate_hidden_price?: boolean;
|
|
2076
|
+
usage_limit?: number;
|
|
2077
|
+
usage_limit_per_rep?: number;
|
|
2078
|
+
usage_limit_per_client?: number;
|
|
2079
|
+
cart_filters_operator: "and" | "or";
|
|
2080
|
+
cart_filters: {
|
|
2081
|
+
_id: string;
|
|
2082
|
+
filter_type:
|
|
2083
|
+
| "product"
|
|
2084
|
+
| "category"
|
|
2085
|
+
| "sub_category"
|
|
2086
|
+
| "product_group"
|
|
2087
|
+
| "brand"
|
|
2088
|
+
| "variant"
|
|
2089
|
+
| "cart_total"
|
|
2090
|
+
| "items_count"
|
|
2091
|
+
| "client"
|
|
2092
|
+
| "tag"
|
|
2093
|
+
| "channel"
|
|
2094
|
+
| "distinct_variants_count"
|
|
2095
|
+
| "distinct_products_count"
|
|
2096
|
+
| "promotion";
|
|
2097
|
+
value: string[];
|
|
2098
|
+
operator: "lte" | "lt" | "gte" | "gt" | "eq";
|
|
2099
|
+
reject_if_pass?: boolean;
|
|
2100
|
+
limit_type: "count" | "price_amount";
|
|
2101
|
+
limit_value: number;
|
|
2102
|
+
}[];
|
|
2103
|
+
items_filters_operator: "and" | "or";
|
|
2104
|
+
items_filters: {
|
|
2105
|
+
_id: string;
|
|
2106
|
+
filter_type:
|
|
2107
|
+
| "product"
|
|
2108
|
+
| "category"
|
|
2109
|
+
| "sub_category"
|
|
2110
|
+
| "product_group"
|
|
2111
|
+
| "brand"
|
|
2112
|
+
| "variant"
|
|
2113
|
+
| "any";
|
|
2114
|
+
value: string[];
|
|
2115
|
+
limit_type: "count" | "price_amount";
|
|
2116
|
+
limit_value: number;
|
|
2117
|
+
}[];
|
|
2118
|
+
get_items_operator: "and" | "or";
|
|
2119
|
+
get_items: {
|
|
2120
|
+
_id: string;
|
|
2121
|
+
filter_type:
|
|
2122
|
+
| "product"
|
|
2123
|
+
| "category"
|
|
2124
|
+
| "sub_category"
|
|
2125
|
+
| "product_group"
|
|
2126
|
+
| "brand"
|
|
2127
|
+
| "variant"
|
|
2128
|
+
| "gift";
|
|
2129
|
+
value: string[];
|
|
2130
|
+
limit_type: "count";
|
|
2131
|
+
limit_value: number;
|
|
2132
|
+
discount_ratio: number;
|
|
2133
|
+
}[];
|
|
2134
|
+
cart_adjustments: {
|
|
2135
|
+
adjustment_type:
|
|
2136
|
+
| "discount_amount"
|
|
2137
|
+
| "discount_ratio"
|
|
2138
|
+
| "shipping_fixed_price"
|
|
2139
|
+
| "shipping_discount_amount"
|
|
2140
|
+
| "shipping_discount_ratio"
|
|
2141
|
+
| "tax_exempt";
|
|
2142
|
+
value: boolean | number;
|
|
2143
|
+
}[];
|
|
2144
|
+
line_filters: {
|
|
2145
|
+
_id: string;
|
|
2146
|
+
filter_type:
|
|
2147
|
+
| "product"
|
|
2148
|
+
| "category"
|
|
2149
|
+
| "sub_category"
|
|
2150
|
+
| "product_group"
|
|
2151
|
+
| "brand"
|
|
2152
|
+
| "variant"
|
|
2153
|
+
| "line_total"
|
|
2154
|
+
| "base_unit_qty"
|
|
2155
|
+
| "promotion";
|
|
2156
|
+
value: string[];
|
|
2157
|
+
operator: "lte" | "lt" | "gte" | "gt" | "eq";
|
|
2158
|
+
reject_if_pass?: boolean;
|
|
2159
|
+
limit_type: "count" | "price_amount";
|
|
2160
|
+
limit_value: number;
|
|
2161
|
+
}[];
|
|
2162
|
+
line_adjustments: {
|
|
2163
|
+
adjustment_type: "discount_amount" | "discount_ratio" | "fixed_price";
|
|
2164
|
+
value: number;
|
|
2165
|
+
}[];
|
|
2166
|
+
line_filters_operator: "and" | "or";
|
|
2167
|
+
is_bulk: { type: boolean; default: false };
|
|
2168
|
+
rounding: "round" | "floor" | "ceil";
|
|
2169
|
+
bulk_over_provide?: boolean;
|
|
2170
|
+
bulk_limit_type?: "count" | "price_amount" | "ratio";
|
|
2171
|
+
bulk_data: {
|
|
2172
|
+
_id: string;
|
|
2173
|
+
from_limit_value: number;
|
|
2174
|
+
to_limit_value?: number;
|
|
2175
|
+
get_limit_value: number;
|
|
2176
|
+
}[];
|
|
2177
|
+
}
|
|
2178
|
+
export interface Schema {
|
|
2179
|
+
_id: string;
|
|
2180
|
+
type: "compound";
|
|
2181
|
+
from: number;
|
|
2182
|
+
to: number;
|
|
2183
|
+
priority?: number;
|
|
2184
|
+
name: string;
|
|
2185
|
+
description?: string;
|
|
2186
|
+
duration?: number;
|
|
2187
|
+
startsAt?: string;
|
|
2188
|
+
disabled?: boolean;
|
|
2189
|
+
details: CompoundSchema;
|
|
2190
|
+
copied_from?: string;
|
|
2191
|
+
ref?: string;
|
|
2192
|
+
company_namespace: string[];
|
|
2193
|
+
createdAt: string;
|
|
2194
|
+
updatedAt: string;
|
|
2195
|
+
__v: number;
|
|
2196
|
+
}
|
|
2197
|
+
}
|
|
2198
|
+
|
|
2199
|
+
export namespace Item {
|
|
2200
|
+
interface Modifier {
|
|
2201
|
+
modifiers_group_id?: string;
|
|
2202
|
+
name?: string;
|
|
2203
|
+
local_name?: string;
|
|
2204
|
+
price?: number;
|
|
2205
|
+
position?: number;
|
|
2206
|
+
disabled?: boolean;
|
|
2207
|
+
company_namespace: string[];
|
|
2208
|
+
overwritePrice?: number;
|
|
2209
|
+
discounted_price?: number;
|
|
2210
|
+
tax_amount?: number;
|
|
2211
|
+
gross_value?: number;
|
|
2212
|
+
}
|
|
2213
|
+
interface ModifierGroup {
|
|
2214
|
+
name?: string;
|
|
2215
|
+
local_name?: string;
|
|
2216
|
+
position?: number;
|
|
2217
|
+
disabled?: boolean;
|
|
2218
|
+
multiple_modifiers?: boolean;
|
|
2219
|
+
company_namespace: string[];
|
|
2220
|
+
modifiers?: Modifier[];
|
|
2221
|
+
group_total?: number;
|
|
2222
|
+
group_total_before_tax?: number;
|
|
2223
|
+
group_tax_total?: number;
|
|
2224
|
+
}
|
|
2225
|
+
export interface Item_Variant {
|
|
2226
|
+
product_id: string;
|
|
2227
|
+
product_name: string;
|
|
2228
|
+
variant_id: string;
|
|
2229
|
+
variant_name: string;
|
|
2230
|
+
listed_price: number;
|
|
2231
|
+
variant_local_name?: string;
|
|
2232
|
+
variant_img?: string;
|
|
2233
|
+
product_local_name?: string;
|
|
2234
|
+
product_img?: string;
|
|
2235
|
+
product_sku?: string;
|
|
2236
|
+
product_barcode?: string;
|
|
2237
|
+
variant_sku?: string;
|
|
2238
|
+
variant_barcode?: string;
|
|
2239
|
+
}
|
|
2240
|
+
export interface Schema {
|
|
2241
|
+
_id: string;
|
|
2242
|
+
variant: Item_Variant;
|
|
2243
|
+
measureunit: {
|
|
2244
|
+
_id: string;
|
|
2245
|
+
name: string;
|
|
2246
|
+
factor: number;
|
|
2247
|
+
parent?: string;
|
|
2248
|
+
disabled?: boolean;
|
|
2249
|
+
company_namespace: string[];
|
|
2250
|
+
};
|
|
2251
|
+
tax: {
|
|
2252
|
+
name: string;
|
|
2253
|
+
rate: number;
|
|
2254
|
+
type: "inclusive" | "additive" | "N/A";
|
|
2255
|
+
disabled?: boolean;
|
|
2256
|
+
};
|
|
2257
|
+
promotions?: Promotion.Schema[];
|
|
2258
|
+
used_promotions?: { id: string; name: string };
|
|
2259
|
+
general_promotions?: { id: string; name: string };
|
|
2260
|
+
applicable_promotions?: { id: string; name: string };
|
|
2261
|
+
modifiers_groups: ModifierGroup[];
|
|
2262
|
+
isAdditional?: boolean;
|
|
2263
|
+
qty: number;
|
|
2264
|
+
base_unit_qty?: number;
|
|
2265
|
+
overwritePrice?: number;
|
|
2266
|
+
price: number;
|
|
2267
|
+
discounted_price: number;
|
|
2268
|
+
tax_amount: number;
|
|
2269
|
+
tax_total: number;
|
|
2270
|
+
discount_value: number;
|
|
2271
|
+
gross_value?: number;
|
|
2272
|
+
line_total?: number;
|
|
2273
|
+
total_before_tax?: number;
|
|
2274
|
+
hidden_price?: number;
|
|
2275
|
+
modifiers_total?: number;
|
|
2276
|
+
modifiers_total_before_tax?: number;
|
|
2277
|
+
modifiers_tax_total?: number;
|
|
2278
|
+
tax_total_without_modifiers?: number;
|
|
2279
|
+
line_total_without_modifiers?: number;
|
|
2280
|
+
total_before_tax_without_modifiers?: number;
|
|
2281
|
+
deductionRatio?: number;
|
|
2282
|
+
deductedTax?: number;
|
|
2283
|
+
deduction?: number;
|
|
2284
|
+
deductionBeforeTax?: number;
|
|
2285
|
+
lineTotalAfterDeduction?: number;
|
|
2286
|
+
company_namespace: string[];
|
|
2287
|
+
class: "invoice" | "return";
|
|
2288
|
+
note?: string;
|
|
2289
|
+
}
|
|
2290
|
+
export interface Body {
|
|
2291
|
+
variant: Item_Variant;
|
|
2292
|
+
measureunit: {
|
|
2293
|
+
_id: string;
|
|
2294
|
+
name: string;
|
|
2295
|
+
factor: number;
|
|
2296
|
+
parent?: string;
|
|
2297
|
+
disabled?: boolean;
|
|
2298
|
+
company_namespace: string[];
|
|
2299
|
+
};
|
|
2300
|
+
tax: {
|
|
2301
|
+
name: string;
|
|
2302
|
+
rate: number;
|
|
2303
|
+
type: "inclusive" | "additive" | "N/A";
|
|
2304
|
+
disabled?: boolean;
|
|
2305
|
+
};
|
|
2306
|
+
promotions?: Promotion.Schema[];
|
|
2307
|
+
used_promotions?: { id: string; name: string };
|
|
2308
|
+
general_promotions?: { id: string; name: string };
|
|
2309
|
+
applicable_promotions?: { id: string; name: string };
|
|
2310
|
+
modifiers_groups?: ModifierGroup[];
|
|
2311
|
+
isAdditional?: boolean;
|
|
2312
|
+
qty: number;
|
|
2313
|
+
base_unit_qty?: number;
|
|
2314
|
+
overwritePrice?: number;
|
|
2315
|
+
price: number;
|
|
2316
|
+
discounted_price: number;
|
|
2317
|
+
tax_amount: number;
|
|
2318
|
+
tax_total: number;
|
|
2319
|
+
discount_value: number;
|
|
2320
|
+
gross_value?: number;
|
|
2321
|
+
line_total?: number;
|
|
2322
|
+
total_before_tax?: number;
|
|
2323
|
+
hidden_price?: number;
|
|
2324
|
+
modifiers_total?: number;
|
|
2325
|
+
modifiers_total_before_tax?: number;
|
|
2326
|
+
modifiers_tax_total?: number;
|
|
2327
|
+
tax_total_without_modifiers?: number;
|
|
2328
|
+
line_total_without_modifiers?: number;
|
|
2329
|
+
total_before_tax_without_modifiers?: number;
|
|
2330
|
+
deductionRatio?: number;
|
|
2331
|
+
deductedTax?: number;
|
|
2332
|
+
deduction?: number;
|
|
2333
|
+
deductionBeforeTax?: number;
|
|
2334
|
+
lineTotalAfterDeduction?: number;
|
|
2335
|
+
company_namespace?: string[];
|
|
2336
|
+
note?: string;
|
|
2337
|
+
}
|
|
2338
|
+
}
|
|
2339
|
+
|
|
2340
|
+
export namespace FullInvoice {
|
|
2341
|
+
interface InvoiceSchema {
|
|
2342
|
+
_id: string;
|
|
2343
|
+
items: Item.Schema[];
|
|
2344
|
+
return_items: Item.Schema[];
|
|
2345
|
+
integration_meta?: { [key: string]: any };
|
|
2346
|
+
external_serial_number?: string;
|
|
2347
|
+
qr_code_tlv?: string;
|
|
2348
|
+
processable?: boolean;
|
|
2349
|
+
client_id: string;
|
|
2350
|
+
client_name: string;
|
|
2351
|
+
comment?: string;
|
|
2352
|
+
return_comment?: string;
|
|
2353
|
+
creator: AdminCreator | RepCreator | ClientCreator;
|
|
2354
|
+
latest?: boolean;
|
|
2355
|
+
version?: number;
|
|
2356
|
+
time?: number;
|
|
2357
|
+
issue_date: string;
|
|
2358
|
+
delivery_date?: string;
|
|
2359
|
+
currency: string;
|
|
2360
|
+
serial_number: SerialNumber;
|
|
2361
|
+
geo_tag?: {
|
|
2362
|
+
type: "Point";
|
|
2363
|
+
coordinates: number[];
|
|
2364
|
+
};
|
|
2365
|
+
sync_id: string;
|
|
2366
|
+
address?: { [key: string]: any };
|
|
2367
|
+
company_namespace: string[];
|
|
2368
|
+
promotions: Promotion.Schema[];
|
|
2369
|
+
priceLists: { [key: string]: any }[];
|
|
2370
|
+
visit_id?: string;
|
|
2371
|
+
teams?: string[];
|
|
2372
|
+
converter?: AdminCreator | RepCreator | ClientCreator;
|
|
2373
|
+
converted_proforma_serial_number?: SerialNumber;
|
|
2374
|
+
converted_proforma_return_serial_number?: SerialNumber;
|
|
2375
|
+
proforma_reference?: string;
|
|
2376
|
+
converted_at?: number;
|
|
2377
|
+
exclude_return_items?: boolean;
|
|
2378
|
+
returned_from?: string;
|
|
2379
|
+
returned_to?: string;
|
|
2380
|
+
returned_from_serial_number?: SerialNumber;
|
|
2381
|
+
returned_to_serial_number?: SerialNumber;
|
|
2382
|
+
is_void?: boolean;
|
|
2383
|
+
due_date: string;
|
|
2384
|
+
return_serial_number?: SerialNumber;
|
|
2385
|
+
origin_warehouse: string;
|
|
2386
|
+
route?: string;
|
|
2387
|
+
paymentsData: {
|
|
2388
|
+
_id: string;
|
|
2389
|
+
invoice_value: number;
|
|
2390
|
+
paid: number;
|
|
2391
|
+
balance: number;
|
|
2392
|
+
payments: PaymentData[];
|
|
2393
|
+
};
|
|
2394
|
+
consumption: {
|
|
2395
|
+
status: "consumed" | "unconsumed" | "partially_consumed";
|
|
2396
|
+
remainder: number;
|
|
2397
|
+
};
|
|
2398
|
+
status: InvoiceStatus;
|
|
2399
|
+
custom_status?: string;
|
|
2400
|
+
subtotal: number;
|
|
2401
|
+
discount_amount: number;
|
|
2402
|
+
taxable_subtotal: number;
|
|
2403
|
+
tax_amount: number;
|
|
2404
|
+
total: number;
|
|
2405
|
+
pre_subtotal: number;
|
|
2406
|
+
pre_discount_amount: number;
|
|
2407
|
+
pre_taxable_subtotal: number;
|
|
2408
|
+
pre_tax_amount: number;
|
|
2409
|
+
pre_total: number;
|
|
2410
|
+
return_subtotal: number;
|
|
2411
|
+
return_discount_amount: number;
|
|
2412
|
+
return_taxable_subtotal: number;
|
|
2413
|
+
return_tax_amount: number;
|
|
2414
|
+
return_total: number;
|
|
2415
|
+
deductionRatio?: number;
|
|
2416
|
+
deductionFixed?: number;
|
|
2417
|
+
totalDeductedTax?: number;
|
|
2418
|
+
totalDeduction?: number;
|
|
2419
|
+
totalDeductionBeforeTax?: number;
|
|
2420
|
+
totalAfterDeduction?: number;
|
|
2421
|
+
taxes?: { [key: string]: any };
|
|
2422
|
+
overwriteDeductionFixed?: number;
|
|
2423
|
+
overwriteTaxExempt?: boolean;
|
|
2424
|
+
tax_exempt?: boolean;
|
|
2425
|
+
overwriteDeductionRatio?: number;
|
|
2426
|
+
shipping_zone?: {
|
|
2427
|
+
geoData: {
|
|
2428
|
+
type: "Polygon";
|
|
2429
|
+
coordinates: number[][][]; // ??????
|
|
2430
|
+
}[];
|
|
2431
|
+
name: string;
|
|
2432
|
+
local_name?: string;
|
|
2433
|
+
shipping_method?: {
|
|
2434
|
+
local_name?: string;
|
|
2435
|
+
name: string;
|
|
2436
|
+
rate?: number;
|
|
2437
|
+
tax?: string;
|
|
2438
|
+
description?: string;
|
|
2439
|
+
local_description?: string;
|
|
2440
|
+
company_namespace: string[];
|
|
2441
|
+
};
|
|
2442
|
+
note?: string;
|
|
2443
|
+
local_note?: string;
|
|
2444
|
+
country: string;
|
|
2445
|
+
reachable: boolean;
|
|
2446
|
+
company_namespace: string[];
|
|
2447
|
+
};
|
|
2448
|
+
payment_method?: {
|
|
2449
|
+
name: string;
|
|
2450
|
+
local_name?: string;
|
|
2451
|
+
fee?: number;
|
|
2452
|
+
rate?: number;
|
|
2453
|
+
type: "online" | "offline";
|
|
2454
|
+
company_namespace: string[];
|
|
2455
|
+
};
|
|
2456
|
+
shipping_price?: number;
|
|
2457
|
+
shipping_tax?: number;
|
|
2458
|
+
shipping_charge?: number;
|
|
2459
|
+
payment_charge?: number;
|
|
2460
|
+
total_with_charges?: number;
|
|
2461
|
+
payment?: { amount?: number };
|
|
2462
|
+
createdAt: string;
|
|
2463
|
+
updatedAt: string;
|
|
2464
|
+
__v: number;
|
|
2465
|
+
}
|
|
2466
|
+
interface CreateBody {
|
|
2467
|
+
items?: Item.Body[];
|
|
2468
|
+
return_items?: Item.Body[];
|
|
2469
|
+
integration_meta?: { [key: string]: any };
|
|
2470
|
+
external_serial_number?: string;
|
|
2471
|
+
processable?: boolean;
|
|
2472
|
+
client_id: string;
|
|
2473
|
+
client_name: string;
|
|
2474
|
+
comment?: string;
|
|
2475
|
+
return_comment?: string;
|
|
2476
|
+
creator?: AdminCreator | RepCreator | ClientCreator;
|
|
2477
|
+
version?: number;
|
|
2478
|
+
time?: number;
|
|
2479
|
+
issue_date: string;
|
|
2480
|
+
delivery_date?: string;
|
|
2481
|
+
currency?: string;
|
|
2482
|
+
serial_number?: SerialNumber;
|
|
2483
|
+
geo_tag?: {
|
|
2484
|
+
type: "Point";
|
|
2485
|
+
coordinates: number[];
|
|
2486
|
+
};
|
|
2487
|
+
sync_id: string;
|
|
2488
|
+
address?: { [key: string]: any };
|
|
2489
|
+
company_namespace?: string[];
|
|
2490
|
+
promotions?: Promotion.Schema[];
|
|
2491
|
+
priceLists: { [key: string]: any }[];
|
|
2492
|
+
visit_id?: string;
|
|
2493
|
+
teams?: string[];
|
|
2494
|
+
due_date: string;
|
|
2495
|
+
return_serial_number?: SerialNumber;
|
|
2496
|
+
origin_warehouse: string;
|
|
2497
|
+
route?: string;
|
|
2498
|
+
custom_status?: string;
|
|
2499
|
+
subtotal: number;
|
|
2500
|
+
discount_amount: number;
|
|
2501
|
+
taxable_subtotal: number;
|
|
2502
|
+
tax_amount: number;
|
|
2503
|
+
total: number;
|
|
2504
|
+
pre_subtotal: number;
|
|
2505
|
+
pre_discount_amount: number;
|
|
2506
|
+
pre_taxable_subtotal: number;
|
|
2507
|
+
pre_tax_amount: number;
|
|
2508
|
+
pre_total: number;
|
|
2509
|
+
return_subtotal: number;
|
|
2510
|
+
return_discount_amount: number;
|
|
2511
|
+
return_taxable_subtotal: number;
|
|
2512
|
+
return_tax_amount: number;
|
|
2513
|
+
return_total: number;
|
|
2514
|
+
deductionRatio?: number;
|
|
2515
|
+
deductionFixed?: number;
|
|
2516
|
+
totalDeductedTax?: number;
|
|
2517
|
+
totalDeduction?: number;
|
|
2518
|
+
totalDeductionBeforeTax?: number;
|
|
2519
|
+
totalAfterDeduction?: number;
|
|
2520
|
+
taxes?: { [key: string]: any };
|
|
2521
|
+
overwriteDeductionFixed?: number;
|
|
2522
|
+
overwriteTaxExempt?: boolean;
|
|
2523
|
+
tax_exempt?: boolean;
|
|
2524
|
+
overwriteDeductionRatio?: number;
|
|
2525
|
+
shipping_zone?: {
|
|
2526
|
+
geoData: {
|
|
2527
|
+
type: "Polygon";
|
|
2528
|
+
coordinates: number[][][];
|
|
2529
|
+
}[];
|
|
2530
|
+
name: string;
|
|
2531
|
+
local_name?: string;
|
|
2532
|
+
shipping_method?: {
|
|
2533
|
+
local_name?: string;
|
|
2534
|
+
name: string;
|
|
2535
|
+
rate?: number;
|
|
2536
|
+
tax?: string;
|
|
2537
|
+
description?: string;
|
|
2538
|
+
local_description?: string;
|
|
2539
|
+
company_namespace: string[];
|
|
2540
|
+
};
|
|
2541
|
+
note?: string;
|
|
2542
|
+
local_note?: string;
|
|
2543
|
+
country: string;
|
|
2544
|
+
reachable: boolean;
|
|
2545
|
+
company_namespace: string[];
|
|
2546
|
+
};
|
|
2547
|
+
payment_method?: {
|
|
2548
|
+
name: string;
|
|
2549
|
+
local_name?: string;
|
|
2550
|
+
fee?: number;
|
|
2551
|
+
rate?: number;
|
|
2552
|
+
type: "online" | "offline";
|
|
2553
|
+
company_namespace: string[];
|
|
2554
|
+
};
|
|
2555
|
+
shipping_price?: number;
|
|
2556
|
+
shipping_tax?: number;
|
|
2557
|
+
shipping_charge?: number;
|
|
2558
|
+
payment_charge?: number;
|
|
2559
|
+
total_with_charges?: number;
|
|
2560
|
+
payment?: { amount?: number };
|
|
2561
|
+
}
|
|
2562
|
+
interface UpdateBody {
|
|
2563
|
+
integration_meta?: { [key: string]: any };
|
|
2564
|
+
issue_date?: string;
|
|
2565
|
+
}
|
|
2566
|
+
|
|
2567
|
+
type InvoiceSchemaWithPopulatedKeys = InvoiceSchema & {
|
|
2568
|
+
items: (Item.Body & {
|
|
2569
|
+
variant: Item.Item_Variant & {
|
|
2570
|
+
variant_id: Pick<Variant.VariantSchema, "sku" | "_id" | "barcode">;
|
|
2571
|
+
product_id: Pick<Product.ProductSchema, "sku" | "_id" | "barcode">;
|
|
2572
|
+
};
|
|
2573
|
+
})[];
|
|
2574
|
+
return_items: (Item.Body & {
|
|
2575
|
+
variant: Item.Item_Variant & {
|
|
2576
|
+
variant_id: Pick<Variant.VariantSchema, "sku" | "_id" | "barcode">;
|
|
2577
|
+
product_id: Pick<Product.ProductSchema, "sku" | "_id" | "barcode">;
|
|
2578
|
+
};
|
|
2579
|
+
})[];
|
|
2580
|
+
client_id?: string | Client.ClientSchema;
|
|
2581
|
+
custom_status?: string | CustomStatus.CustomStatusSchema;
|
|
2582
|
+
tax_number?: string | Pick<Client.ClientSchema, "_id" | "tax_number">;
|
|
2583
|
+
};
|
|
2584
|
+
|
|
2585
|
+
type InvoiceStatus = "paid" | "unpaid" | "partially_paid";
|
|
2586
|
+
type PopulatedKeys = "client" | "tax_number" | "custom_status";
|
|
2587
|
+
type SortingKeys =
|
|
2588
|
+
| "line_total"
|
|
2589
|
+
| "product_name"
|
|
2590
|
+
| "variant_name"
|
|
2591
|
+
| "product_sku"
|
|
2592
|
+
| "product_barcode"
|
|
2593
|
+
| "variant_sku"
|
|
2594
|
+
| "variant_barcode";
|
|
2595
|
+
export namespace Find {
|
|
2596
|
+
export type Params = DefaultPaginationQueryParams & {
|
|
2597
|
+
_id?: string[] | string;
|
|
2598
|
+
"creator._id"?: string[] | string;
|
|
2599
|
+
creator?: string[] | string;
|
|
2600
|
+
client_id?: string[] | string;
|
|
2601
|
+
clients?: string[] | string;
|
|
2602
|
+
from_issue_date?: number;
|
|
2603
|
+
to_issue_date?: number;
|
|
2604
|
+
origin_warehouse?: string[] | string;
|
|
2605
|
+
custom_status?: string[] | string;
|
|
2606
|
+
status?: InvoiceStatus | InvoiceStatus[];
|
|
2607
|
+
is_void: false;
|
|
2608
|
+
has_return?: boolean;
|
|
2609
|
+
[key: string]: any; // integration_meta.
|
|
2610
|
+
populatedKeys?: PopulatedKeys[];
|
|
2611
|
+
sortPage?: SortingKeys;
|
|
2612
|
+
};
|
|
2613
|
+
export interface Result extends DefaultPaginationResult {
|
|
2614
|
+
data: InvoiceSchemaWithPopulatedKeys[];
|
|
2615
|
+
absolute_total: number;
|
|
2616
|
+
page_total: number;
|
|
2617
|
+
}
|
|
2618
|
+
}
|
|
2619
|
+
|
|
2620
|
+
export namespace Get {
|
|
2621
|
+
export type ID = string;
|
|
2622
|
+
export interface Params {
|
|
2623
|
+
populatedKeys?: PopulatedKeys[];
|
|
2624
|
+
sortPage?: SortingKeys;
|
|
2625
|
+
}
|
|
2626
|
+
export type Result = InvoiceSchemaWithPopulatedKeys;
|
|
2627
|
+
}
|
|
2628
|
+
|
|
2629
|
+
export namespace Create {
|
|
2630
|
+
export type Body = CreateBody;
|
|
2631
|
+
export type Result = InvoiceSchema;
|
|
2632
|
+
}
|
|
2633
|
+
|
|
2634
|
+
export namespace Update {
|
|
2635
|
+
export type ID = string;
|
|
2636
|
+
export type Body = UpdateBody;
|
|
2637
|
+
export type Result = InvoiceSchema;
|
|
2638
|
+
}
|
|
2639
|
+
}
|
|
2640
|
+
|
|
2641
|
+
export namespace Proforma {
|
|
2642
|
+
interface ProformaSchema {
|
|
2643
|
+
_id: string;
|
|
2644
|
+
items: Item.Schema[];
|
|
2645
|
+
integration_meta?: { [key: string]: any };
|
|
2646
|
+
external_serial_number?: string;
|
|
2647
|
+
processable?: boolean;
|
|
2648
|
+
client_id: string;
|
|
2649
|
+
client_name: string;
|
|
2650
|
+
comment?: string;
|
|
2651
|
+
creator: AdminCreator | RepCreator | ClientCreator;
|
|
2652
|
+
latest: boolean;
|
|
2653
|
+
version?: number;
|
|
2654
|
+
time?: number;
|
|
2655
|
+
issue_date: string;
|
|
2656
|
+
delivery_date?: string;
|
|
2657
|
+
currency: string;
|
|
2658
|
+
serial_number: SerialNumber;
|
|
2659
|
+
geo_tag?: {
|
|
2660
|
+
type: "Point";
|
|
2661
|
+
coordinates: number[];
|
|
2662
|
+
};
|
|
2663
|
+
sync_id: string;
|
|
2664
|
+
address?: { [key: string]: any };
|
|
2665
|
+
company_namespace: string[];
|
|
2666
|
+
promotions: Promotion.Schema[];
|
|
2667
|
+
priceLists: { [key: string]: any }[];
|
|
2668
|
+
visit_id?: string;
|
|
2669
|
+
teams?: string[];
|
|
2670
|
+
converter?: AdminCreator | RepCreator | ClientCreator;
|
|
2671
|
+
invoice_reference?: string;
|
|
2672
|
+
converted_at?: number;
|
|
2673
|
+
route?: string;
|
|
2674
|
+
status: ProformaStatus;
|
|
2675
|
+
custom_status?: string;
|
|
2676
|
+
editor?: AdminCreator | RepCreator | ClientCreator;
|
|
2677
|
+
disabled: boolean;
|
|
2678
|
+
subtotal: number;
|
|
2679
|
+
discount_amount: number;
|
|
2680
|
+
taxable_subtotal: number;
|
|
2681
|
+
tax_amount: number;
|
|
2682
|
+
total: number;
|
|
2683
|
+
pre_subtotal?: number;
|
|
2684
|
+
pre_discount_amount?: number;
|
|
2685
|
+
pre_taxable_subtotal?: number;
|
|
2686
|
+
pre_tax_amount?: number;
|
|
2687
|
+
pre_total?: number;
|
|
2688
|
+
return_subtotal?: number;
|
|
2689
|
+
return_discount_amount?: number;
|
|
2690
|
+
return_taxable_subtotal?: number;
|
|
2691
|
+
return_tax_amount?: number;
|
|
2692
|
+
return_total?: number;
|
|
2693
|
+
deductionRatio?: number;
|
|
2694
|
+
deductionFixed?: number;
|
|
2695
|
+
totalDeductedTax?: number;
|
|
2696
|
+
totalDeduction?: number;
|
|
2697
|
+
totalDeductionBeforeTax?: number;
|
|
2698
|
+
totalAfterDeduction?: number;
|
|
2699
|
+
taxes?: { [key: string]: any };
|
|
2700
|
+
overwriteDeductionFixed?: number;
|
|
2701
|
+
overwriteTaxExempt?: boolean;
|
|
2702
|
+
tax_exempt?: boolean;
|
|
2703
|
+
overwriteDeductionRatio?: number;
|
|
2704
|
+
shipping_zone?: {
|
|
2705
|
+
geoData: {
|
|
2706
|
+
type: "Polygon";
|
|
2707
|
+
coordinates: number[][][];
|
|
2708
|
+
}[];
|
|
2709
|
+
name: string;
|
|
2710
|
+
local_name?: string;
|
|
2711
|
+
shipping_method?: {
|
|
2712
|
+
local_name?: string;
|
|
2713
|
+
name: string;
|
|
2714
|
+
rate?: number;
|
|
2715
|
+
tax?: string;
|
|
2716
|
+
description?: string;
|
|
2717
|
+
local_description?: string;
|
|
2718
|
+
company_namespace: string[];
|
|
2719
|
+
};
|
|
2720
|
+
note?: string;
|
|
2721
|
+
local_note?: string;
|
|
2722
|
+
country: string;
|
|
2723
|
+
reachable: boolean;
|
|
2724
|
+
company_namespace: string[];
|
|
2725
|
+
};
|
|
2726
|
+
payment_method?: {
|
|
2727
|
+
name: string;
|
|
2728
|
+
local_name?: string;
|
|
2729
|
+
fee?: number;
|
|
2730
|
+
rate?: number;
|
|
2731
|
+
type: "online" | "offline";
|
|
2732
|
+
company_namespace: string[];
|
|
2733
|
+
};
|
|
2734
|
+
shipping_price?: number;
|
|
2735
|
+
shipping_tax?: number;
|
|
2736
|
+
shipping_charge?: number;
|
|
2737
|
+
payment_charge?: number;
|
|
2738
|
+
total_with_charges?: number;
|
|
2739
|
+
createdAt: string;
|
|
2740
|
+
updatedAt: string;
|
|
2741
|
+
__v: number;
|
|
2742
|
+
}
|
|
2743
|
+
interface CreateBody {
|
|
2744
|
+
items: Item.Schema[];
|
|
2745
|
+
integration_meta?: { [key: string]: any };
|
|
2746
|
+
external_serial_number?: string;
|
|
2747
|
+
processable?: boolean;
|
|
2748
|
+
client_id: string;
|
|
2749
|
+
client_name: string;
|
|
2750
|
+
comment?: string;
|
|
2751
|
+
creator: AdminCreator | RepCreator | ClientCreator;
|
|
2752
|
+
version?: number;
|
|
2753
|
+
time?: number;
|
|
2754
|
+
issue_date: string;
|
|
2755
|
+
delivery_date?: string;
|
|
2756
|
+
currency?: string;
|
|
2757
|
+
serial_number?: SerialNumber;
|
|
2758
|
+
geo_tag?: {
|
|
2759
|
+
type: "Point";
|
|
2760
|
+
coordinates: number[];
|
|
2761
|
+
};
|
|
2762
|
+
sync_id: string;
|
|
2763
|
+
address?: { [key: string]: any };
|
|
2764
|
+
company_namespace?: string[];
|
|
2765
|
+
promotions?: Promotion.Schema[];
|
|
2766
|
+
priceLists?: { [key: string]: any }[];
|
|
2767
|
+
visit_id?: string;
|
|
2768
|
+
teams?: string[];
|
|
2769
|
+
route?: string;
|
|
2770
|
+
custom_status?: string;
|
|
2771
|
+
disabled?: boolean;
|
|
2772
|
+
subtotal: number;
|
|
2773
|
+
discount_amount: number;
|
|
2774
|
+
taxable_subtotal: number;
|
|
2775
|
+
tax_amount: number;
|
|
2776
|
+
total: number;
|
|
2777
|
+
pre_subtotal?: number;
|
|
2778
|
+
pre_discount_amount?: number;
|
|
2779
|
+
pre_taxable_subtotal?: number;
|
|
2780
|
+
pre_tax_amount?: number;
|
|
2781
|
+
pre_total?: number;
|
|
2782
|
+
return_subtotal?: number;
|
|
2783
|
+
return_discount_amount?: number;
|
|
2784
|
+
return_taxable_subtotal?: number;
|
|
2785
|
+
return_tax_amount?: number;
|
|
2786
|
+
return_total?: number;
|
|
2787
|
+
deductionRatio?: number;
|
|
2788
|
+
deductionFixed?: number;
|
|
2789
|
+
totalDeductedTax?: number;
|
|
2790
|
+
totalDeduction?: number;
|
|
2791
|
+
totalDeductionBeforeTax?: number;
|
|
2792
|
+
totalAfterDeduction?: number;
|
|
2793
|
+
taxes?: { [key: string]: any };
|
|
2794
|
+
overwriteDeductionFixed?: number;
|
|
2795
|
+
overwriteTaxExempt?: boolean;
|
|
2796
|
+
tax_exempt?: boolean;
|
|
2797
|
+
overwriteDeductionRatio?: number;
|
|
2798
|
+
shipping_zone?: {
|
|
2799
|
+
geoData: {
|
|
2800
|
+
type: "Polygon";
|
|
2801
|
+
coordinates: number[][][];
|
|
2802
|
+
}[];
|
|
2803
|
+
name: string;
|
|
2804
|
+
local_name?: string;
|
|
2805
|
+
shipping_method?: {
|
|
2806
|
+
local_name?: string;
|
|
2807
|
+
name: string;
|
|
2808
|
+
rate?: number;
|
|
2809
|
+
tax?: string;
|
|
2810
|
+
description?: string;
|
|
2811
|
+
local_description?: string;
|
|
2812
|
+
company_namespace: string[];
|
|
2813
|
+
};
|
|
2814
|
+
note?: string;
|
|
2815
|
+
local_note?: string;
|
|
2816
|
+
country: string;
|
|
2817
|
+
reachable: boolean;
|
|
2818
|
+
company_namespace: string[];
|
|
2819
|
+
};
|
|
2820
|
+
payment_method?: {
|
|
2821
|
+
name: string;
|
|
2822
|
+
local_name?: string;
|
|
2823
|
+
fee?: number;
|
|
2824
|
+
rate?: number;
|
|
2825
|
+
type: "online" | "offline";
|
|
2826
|
+
company_namespace: string[];
|
|
2827
|
+
};
|
|
2828
|
+
shipping_price?: number;
|
|
2829
|
+
shipping_tax?: number;
|
|
2830
|
+
shipping_charge?: number;
|
|
2831
|
+
payment_charge?: number;
|
|
2832
|
+
total_with_charges?: number;
|
|
2833
|
+
}
|
|
2834
|
+
interface UpdateBody {
|
|
2835
|
+
_id?: string;
|
|
2836
|
+
items?: Item.Schema[];
|
|
2837
|
+
integration_meta?: { [key: string]: any };
|
|
2838
|
+
external_serial_number?: string;
|
|
2839
|
+
processable?: boolean;
|
|
2840
|
+
client_id?: string;
|
|
2841
|
+
client_name?: string;
|
|
2842
|
+
comment?: string;
|
|
2843
|
+
creator?: AdminCreator | RepCreator | ClientCreator;
|
|
2844
|
+
latest?: boolean;
|
|
2845
|
+
version?: number;
|
|
2846
|
+
time?: number;
|
|
2847
|
+
issue_date?: string;
|
|
2848
|
+
delivery_date?: string;
|
|
2849
|
+
currency?: string;
|
|
2850
|
+
serial_number?: SerialNumber;
|
|
2851
|
+
geo_tag?: {
|
|
2852
|
+
type: "Point";
|
|
2853
|
+
coordinates: number[];
|
|
2854
|
+
};
|
|
2855
|
+
sync_id?: string;
|
|
2856
|
+
address?: { [key: string]: any };
|
|
2857
|
+
company_namespace?: string[];
|
|
2858
|
+
promotions?: Promotion.Schema[];
|
|
2859
|
+
priceLists?: { [key: string]: any }[];
|
|
2860
|
+
visit_id?: string;
|
|
2861
|
+
teams?: string[];
|
|
2862
|
+
converter?: AdminCreator | RepCreator | ClientCreator;
|
|
2863
|
+
invoice_reference?: string;
|
|
2864
|
+
converted_at?: number;
|
|
2865
|
+
route?: string;
|
|
2866
|
+
status?: ProformaStatus;
|
|
2867
|
+
custom_status?: string;
|
|
2868
|
+
editor?: AdminCreator | RepCreator | ClientCreator;
|
|
2869
|
+
disabled?: boolean;
|
|
2870
|
+
subtotal?: number;
|
|
2871
|
+
discount_amount?: number;
|
|
2872
|
+
taxable_subtotal?: number;
|
|
2873
|
+
tax_amount?: number;
|
|
2874
|
+
total?: number;
|
|
2875
|
+
pre_subtotal?: number;
|
|
2876
|
+
pre_discount_amount?: number;
|
|
2877
|
+
pre_taxable_subtotal?: number;
|
|
2878
|
+
pre_tax_amount?: number;
|
|
2879
|
+
pre_total?: number;
|
|
2880
|
+
return_subtotal?: number;
|
|
2881
|
+
return_discount_amount?: number;
|
|
2882
|
+
return_taxable_subtotal?: number;
|
|
2883
|
+
return_tax_amount?: number;
|
|
2884
|
+
return_total?: number;
|
|
2885
|
+
deductionRatio?: number;
|
|
2886
|
+
deductionFixed?: number;
|
|
2887
|
+
totalDeductedTax?: number;
|
|
2888
|
+
totalDeduction?: number;
|
|
2889
|
+
totalDeductionBeforeTax?: number;
|
|
2890
|
+
totalAfterDeduction?: number;
|
|
2891
|
+
taxes?: { [key: string]: any };
|
|
2892
|
+
overwriteDeductionFixed?: number;
|
|
2893
|
+
overwriteTaxExempt?: boolean;
|
|
2894
|
+
tax_exempt?: boolean;
|
|
2895
|
+
overwriteDeductionRatio?: number;
|
|
2896
|
+
shipping_zone?: {
|
|
2897
|
+
geoData: {
|
|
2898
|
+
type: "Polygon";
|
|
2899
|
+
coordinates: number[][][];
|
|
2900
|
+
}[];
|
|
2901
|
+
name: string;
|
|
2902
|
+
local_name?: string;
|
|
2903
|
+
shipping_method?: {
|
|
2904
|
+
local_name?: string;
|
|
2905
|
+
name: string;
|
|
2906
|
+
rate?: number;
|
|
2907
|
+
tax?: string;
|
|
2908
|
+
description?: string;
|
|
2909
|
+
local_description?: string;
|
|
2910
|
+
company_namespace: string[];
|
|
2911
|
+
};
|
|
2912
|
+
note?: string;
|
|
2913
|
+
local_note?: string;
|
|
2914
|
+
country: string;
|
|
2915
|
+
reachable: boolean;
|
|
2916
|
+
company_namespace: string[];
|
|
2917
|
+
};
|
|
2918
|
+
payment_method?: {
|
|
2919
|
+
name: string;
|
|
2920
|
+
local_name?: string;
|
|
2921
|
+
fee?: number;
|
|
2922
|
+
rate?: number;
|
|
2923
|
+
type: "online" | "offline";
|
|
2924
|
+
company_namespace: string[];
|
|
2925
|
+
};
|
|
2926
|
+
shipping_price?: number;
|
|
2927
|
+
shipping_tax?: number;
|
|
2928
|
+
shipping_charge?: number;
|
|
2929
|
+
payment_charge?: number;
|
|
2930
|
+
total_with_charges?: number;
|
|
2931
|
+
createdAt?: string;
|
|
2932
|
+
updatedAt?: string;
|
|
2933
|
+
__v?: number;
|
|
2934
|
+
}
|
|
2935
|
+
|
|
2936
|
+
type ProformaSchemaWithPopulatedKeys = ProformaSchema & {
|
|
2937
|
+
items: (Item.Body & {
|
|
2938
|
+
variant: Item.Item_Variant & {
|
|
2939
|
+
variant_sku?: string;
|
|
2940
|
+
product_sku?: string;
|
|
2941
|
+
variant_barcode?: string;
|
|
2942
|
+
product_barcode?: string;
|
|
2943
|
+
};
|
|
2944
|
+
})[];
|
|
2945
|
+
client_id?: string | Client.ClientSchema;
|
|
2946
|
+
custom_status?: string | CustomStatus.CustomStatusSchema;
|
|
2947
|
+
cycle?: Cycle.Schema;
|
|
2948
|
+
};
|
|
2949
|
+
type PopulatedKeys = "custom_status";
|
|
2950
|
+
type ProformaStatus = "pending" | "approved" | "processing" | "rejected";
|
|
2951
|
+
type SortingKeys =
|
|
2952
|
+
| "product_sku"
|
|
2953
|
+
| "product_barcode"
|
|
2954
|
+
| "variant_name"
|
|
2955
|
+
| "product_name"
|
|
2956
|
+
| "variant_sku"
|
|
2957
|
+
| "variant_barcode";
|
|
2958
|
+
export namespace Find {
|
|
2959
|
+
export type Params = DefaultPaginationQueryParams & {
|
|
2960
|
+
_id?: string[] | string;
|
|
2961
|
+
"creator._id"?: string[] | string;
|
|
2962
|
+
creator?: string[] | string;
|
|
2963
|
+
clients?: string[] | string;
|
|
2964
|
+
disabled?: boolean;
|
|
2965
|
+
latest?: boolean;
|
|
2966
|
+
"serial_number.formatted"?: string[] | string;
|
|
2967
|
+
client_id?: string[] | string;
|
|
2968
|
+
from_issue_date?: number;
|
|
2969
|
+
to_issue_date?: number;
|
|
2970
|
+
from_time?: number;
|
|
2971
|
+
to_time?: number;
|
|
2972
|
+
from_createdAt?: number;
|
|
2973
|
+
to_createdAt?: number;
|
|
2974
|
+
from_updatedAt?: number;
|
|
2975
|
+
to_updatedAt?: number;
|
|
2976
|
+
custom_status?: string[] | string;
|
|
2977
|
+
status?: ProformaStatus | ProformaStatus[];
|
|
2978
|
+
[key: string]: any; // integration_meta.
|
|
2979
|
+
sortPage?: SortingKeys;
|
|
2980
|
+
export?: "excel";
|
|
2981
|
+
withClientDetails?: boolean;
|
|
2982
|
+
populatedKeys?: PopulatedKeys[];
|
|
2983
|
+
nodeCycles?: string[] | string;
|
|
2984
|
+
withCycle?: boolean;
|
|
2985
|
+
};
|
|
2986
|
+
export interface Result extends DefaultPaginationResult {
|
|
2987
|
+
data: ProformaSchemaWithPopulatedKeys[];
|
|
2988
|
+
}
|
|
2989
|
+
}
|
|
2990
|
+
|
|
2991
|
+
export namespace Get {
|
|
2992
|
+
export type ID = string;
|
|
2993
|
+
export interface Params {
|
|
2994
|
+
sortPage?: SortingKeys;
|
|
2995
|
+
withClientDetails?: boolean;
|
|
2996
|
+
withCycle?: boolean;
|
|
2997
|
+
}
|
|
2998
|
+
export type Result =
|
|
2999
|
+
| (ProformaSchemaWithPopulatedKeys & {
|
|
3000
|
+
custom_status: CustomStatus.CustomStatusSchema;
|
|
3001
|
+
})
|
|
3002
|
+
| {
|
|
3003
|
+
proforma: ProformaSchemaWithPopulatedKeys & {
|
|
3004
|
+
custom_status: CustomStatus.CustomStatusSchema;
|
|
3005
|
+
};
|
|
3006
|
+
cycle: Cycle.Schema & {
|
|
3007
|
+
can_edit: boolean;
|
|
3008
|
+
current_nodes: string[];
|
|
3009
|
+
};
|
|
3010
|
+
};
|
|
3011
|
+
}
|
|
3012
|
+
|
|
3013
|
+
export namespace Create {
|
|
3014
|
+
export type Body = CreateBody;
|
|
3015
|
+
export type Result = ProformaSchema;
|
|
3016
|
+
}
|
|
3017
|
+
|
|
3018
|
+
export namespace Update {
|
|
3019
|
+
export type ID = string;
|
|
3020
|
+
export type Body = UpdateBody;
|
|
3021
|
+
export type Result = ProformaSchema;
|
|
3022
|
+
}
|
|
3023
|
+
}
|
|
3024
|
+
|
|
3025
|
+
export namespace Payment {
|
|
3026
|
+
interface PaymentSchema {
|
|
3027
|
+
_id: string;
|
|
3028
|
+
status: PaymentStatus;
|
|
3029
|
+
remainder: number;
|
|
3030
|
+
amount: number;
|
|
3031
|
+
client_id: string;
|
|
3032
|
+
client_name: string;
|
|
3033
|
+
creator: AdminCreator | RepCreator;
|
|
3034
|
+
time?: number;
|
|
3035
|
+
serial_number: SerialNumber;
|
|
3036
|
+
route?: string;
|
|
3037
|
+
paytime: string;
|
|
3038
|
+
note?: string;
|
|
3039
|
+
currency: string;
|
|
3040
|
+
payment_type: PaymentType;
|
|
3041
|
+
check?: Check;
|
|
3042
|
+
LinkedTxn?: {
|
|
3043
|
+
Txn_serial_number: SerialNumber;
|
|
3044
|
+
Txn_invoice_total: number;
|
|
3045
|
+
TxnType: "refund" | "invoice";
|
|
3046
|
+
};
|
|
3047
|
+
company_namespace: string[];
|
|
3048
|
+
integration_meta?: { [key: string]: any };
|
|
3049
|
+
sync_id: string;
|
|
3050
|
+
custom_status?: string;
|
|
3051
|
+
visit_id?: string;
|
|
3052
|
+
teams?: string[];
|
|
3053
|
+
paymentsData: {
|
|
3054
|
+
amount: number;
|
|
3055
|
+
paid: number;
|
|
3056
|
+
balance: number;
|
|
3057
|
+
payments: PaymentData[];
|
|
3058
|
+
};
|
|
3059
|
+
createdAt: string;
|
|
3060
|
+
updatedAt: string;
|
|
3061
|
+
__v: number;
|
|
3062
|
+
}
|
|
3063
|
+
interface CreateBody {
|
|
3064
|
+
amount: number;
|
|
3065
|
+
client_id: string;
|
|
3066
|
+
client_name: string;
|
|
3067
|
+
time?: number;
|
|
3068
|
+
serial_number?: SerialNumber;
|
|
3069
|
+
route?: string;
|
|
3070
|
+
paytime: string;
|
|
3071
|
+
note?: string;
|
|
3072
|
+
currency: string;
|
|
3073
|
+
payment_type: PaymentType;
|
|
3074
|
+
check?: Check;
|
|
3075
|
+
LinkedTxn?: {
|
|
3076
|
+
Txn_serial_number: SerialNumber;
|
|
3077
|
+
Txn_invoice_total: number;
|
|
3078
|
+
TxnType: "refund" | "invoice";
|
|
3079
|
+
};
|
|
3080
|
+
company_namespace?: string[];
|
|
3081
|
+
integration_meta?: { [key: string]: any };
|
|
3082
|
+
sync_id: string;
|
|
3083
|
+
custom_status?: string;
|
|
3084
|
+
visit_id?: string;
|
|
3085
|
+
teams?: string[];
|
|
3086
|
+
}
|
|
3087
|
+
interface UpdateBody {
|
|
3088
|
+
integration_meta?: { [key: string]: any };
|
|
3089
|
+
}
|
|
3090
|
+
|
|
3091
|
+
type PaymentSchemaWithPopulatedKeys = PaymentSchema & {
|
|
3092
|
+
balance_to_refund: number;
|
|
3093
|
+
custom_status?: string | CustomStatus.CustomStatusSchema;
|
|
3094
|
+
check?: Check & { bank: Bank.BankSchema };
|
|
3095
|
+
invoice?: {
|
|
3096
|
+
invoice_serial_number: string;
|
|
3097
|
+
invoice_date: string;
|
|
3098
|
+
invoice_due_date: string;
|
|
3099
|
+
original_amount: number;
|
|
3100
|
+
payment: number;
|
|
3101
|
+
};
|
|
3102
|
+
};
|
|
3103
|
+
type PaymentType = "check" | "cash";
|
|
3104
|
+
type PopulatedKeys = "custom_status";
|
|
3105
|
+
type PaymentStatus = "consumed" | "unconsumed" | "partially_consumed";
|
|
3106
|
+
export namespace Find {
|
|
3107
|
+
export type Params = DefaultPaginationQueryParams & {
|
|
3108
|
+
_id?: string[] | string;
|
|
3109
|
+
"creator._id"?: string[] | string;
|
|
3110
|
+
client_id?: string[] | string;
|
|
3111
|
+
from_paytime?: number;
|
|
3112
|
+
to_paytime?: number;
|
|
3113
|
+
custom_status?: string[] | string;
|
|
3114
|
+
payment_type?: PaymentType | PaymentType[];
|
|
3115
|
+
creator?: string[] | string;
|
|
3116
|
+
clients?: string[] | string;
|
|
3117
|
+
withPrintDetails?: boolean;
|
|
3118
|
+
[key: string]: any; // integration_meta.
|
|
3119
|
+
populatedKeys?: PopulatedKeys[];
|
|
3120
|
+
};
|
|
3121
|
+
export interface Result extends DefaultPaginationResult {
|
|
3122
|
+
data: PaymentSchemaWithPopulatedKeys[];
|
|
3123
|
+
absolute_total: number;
|
|
3124
|
+
page_total: number;
|
|
3125
|
+
}
|
|
3126
|
+
}
|
|
3127
|
+
|
|
3128
|
+
export namespace Get {
|
|
3129
|
+
export type ID = string;
|
|
3130
|
+
export interface Params {
|
|
3131
|
+
withPrintDetails?: boolean;
|
|
3132
|
+
populatedKeys?: PopulatedKeys[];
|
|
3133
|
+
}
|
|
3134
|
+
export type Result = PaymentSchemaWithPopulatedKeys & {
|
|
3135
|
+
custom_status: CustomStatus.CustomStatusSchema;
|
|
3136
|
+
};
|
|
3137
|
+
}
|
|
3138
|
+
|
|
3139
|
+
export namespace Create {
|
|
3140
|
+
export type Body = CreateBody;
|
|
3141
|
+
export type Result = PaymentSchema;
|
|
3142
|
+
}
|
|
3143
|
+
|
|
3144
|
+
export namespace Update {
|
|
3145
|
+
export type ID = string;
|
|
3146
|
+
export type Body = UpdateBody;
|
|
3147
|
+
export type Result = PaymentSchema;
|
|
3148
|
+
}
|
|
3149
|
+
}
|
|
3150
|
+
|
|
3151
|
+
export namespace Cycle {
|
|
3152
|
+
type CycleStatus = "pending" | "approved" | "processing" | "rejected";
|
|
3153
|
+
export interface Schema {
|
|
3154
|
+
_id: string;
|
|
3155
|
+
document_type: "proforma" | "transfer";
|
|
3156
|
+
document_id: string;
|
|
3157
|
+
status: CycleStatus;
|
|
3158
|
+
node?: AdminCreator | RepCreator | ClientCreator;
|
|
3159
|
+
creator?: AdminCreator | RepCreator | ClientCreator;
|
|
3160
|
+
current_nodes: {
|
|
3161
|
+
admin: string;
|
|
3162
|
+
admin_name: string;
|
|
3163
|
+
}[];
|
|
3164
|
+
stage?: number;
|
|
3165
|
+
stageName?: string;
|
|
3166
|
+
company_namespace: string[];
|
|
3167
|
+
note?: string;
|
|
3168
|
+
serial_number: SerialNumber;
|
|
3169
|
+
version: number;
|
|
3170
|
+
history: {
|
|
3171
|
+
_id: string;
|
|
3172
|
+
status: CycleStatus;
|
|
3173
|
+
stage: number;
|
|
3174
|
+
stageName: string;
|
|
3175
|
+
node: AdminCreator | RepCreator | ClientCreator;
|
|
3176
|
+
creator: AdminCreator | RepCreator | ClientCreator;
|
|
3177
|
+
note: string;
|
|
3178
|
+
serial_number: SerialNumber;
|
|
3179
|
+
version?: number;
|
|
3180
|
+
createdAt: string;
|
|
3181
|
+
updatedAt: string;
|
|
3182
|
+
__v: number;
|
|
3183
|
+
}[];
|
|
3184
|
+
createdAt: string;
|
|
3185
|
+
updatedAt: string;
|
|
3186
|
+
__v: number;
|
|
3187
|
+
}
|
|
3188
|
+
}
|
|
3189
|
+
|
|
3190
|
+
export namespace Transfer {
|
|
3191
|
+
interface VariantTransfer {
|
|
3192
|
+
variant_id: string;
|
|
3193
|
+
variant_name?: string;
|
|
3194
|
+
product_id?: string;
|
|
3195
|
+
product_name?: string;
|
|
3196
|
+
qty: number;
|
|
3197
|
+
measure_unit_id?: string;
|
|
3198
|
+
measure_unit_name?: string;
|
|
3199
|
+
measure_unit_qty?: number;
|
|
3200
|
+
measure_unit_factor?: number;
|
|
3201
|
+
}
|
|
3202
|
+
interface Schema {
|
|
3203
|
+
_id: string;
|
|
3204
|
+
serial_number: SerialNumber;
|
|
3205
|
+
time: number;
|
|
3206
|
+
creator: AdminCreator | RepCreator;
|
|
3207
|
+
type: TransferType;
|
|
3208
|
+
from: string;
|
|
3209
|
+
to: string;
|
|
3210
|
+
status: TransferStatus;
|
|
3211
|
+
variants: VariantTransfer[];
|
|
3212
|
+
items_count?: number;
|
|
3213
|
+
total_items_base_unit_qty?: number;
|
|
3214
|
+
teams?: string[];
|
|
3215
|
+
custom_status?: string;
|
|
3216
|
+
sync_id: string;
|
|
3217
|
+
integration_meta?: { [key: string]: any };
|
|
3218
|
+
company_namespace: string[];
|
|
3219
|
+
createdAt: string;
|
|
3220
|
+
updatedAt: string;
|
|
3221
|
+
__v: number;
|
|
3222
|
+
}
|
|
3223
|
+
interface CreateBody {
|
|
3224
|
+
serial_number?: SerialNumber;
|
|
3225
|
+
time: number;
|
|
3226
|
+
type?: TransferType;
|
|
3227
|
+
from: string;
|
|
3228
|
+
to: string;
|
|
3229
|
+
variants: {
|
|
3230
|
+
variant_id: string;
|
|
3231
|
+
variant_name?: string;
|
|
3232
|
+
product_id?: string;
|
|
3233
|
+
product_name?: string;
|
|
3234
|
+
qty: number;
|
|
3235
|
+
measureunit?: {
|
|
3236
|
+
_id: string;
|
|
3237
|
+
name: string;
|
|
3238
|
+
factor: number;
|
|
3239
|
+
[key: string]: any;
|
|
3240
|
+
};
|
|
3241
|
+
}[];
|
|
3242
|
+
custom_status?: string;
|
|
3243
|
+
sync_id: string;
|
|
3244
|
+
integration_meta?: { [key: string]: any };
|
|
3245
|
+
}
|
|
3246
|
+
type UpdateBody =
|
|
3247
|
+
| {
|
|
3248
|
+
_id?: string;
|
|
3249
|
+
serial_number?: SerialNumber;
|
|
3250
|
+
time?: number;
|
|
3251
|
+
creator?: AdminCreator | RepCreator;
|
|
3252
|
+
type?: TransferType;
|
|
3253
|
+
from?: string;
|
|
3254
|
+
to?: string;
|
|
3255
|
+
status?: "pending" | "approved" | "processing" | "rejected";
|
|
3256
|
+
variants?: (
|
|
3257
|
+
| VariantTransfer
|
|
3258
|
+
| {
|
|
3259
|
+
variant_id: string;
|
|
3260
|
+
variant_name?: string;
|
|
3261
|
+
product_id?: string;
|
|
3262
|
+
product_name?: string;
|
|
3263
|
+
qty: number;
|
|
3264
|
+
measureunit?: {
|
|
3265
|
+
_id: string;
|
|
3266
|
+
name: string;
|
|
3267
|
+
factor: number;
|
|
3268
|
+
[key: string]: any;
|
|
3269
|
+
};
|
|
3270
|
+
}
|
|
3271
|
+
)[];
|
|
3272
|
+
items_count?: number;
|
|
3273
|
+
total_items_base_unit_qty?: number;
|
|
3274
|
+
teams?: string[];
|
|
3275
|
+
custom_status?: string;
|
|
3276
|
+
sync_id?: string;
|
|
3277
|
+
integration_meta?: { [key: string]: any };
|
|
3278
|
+
company_namespace?: string[];
|
|
3279
|
+
createdAt?: string;
|
|
3280
|
+
updatedAt?: string;
|
|
3281
|
+
__v?: number;
|
|
3282
|
+
}
|
|
3283
|
+
| {
|
|
3284
|
+
integration_meta?: { [key: string]: any };
|
|
3285
|
+
};
|
|
3286
|
+
|
|
3287
|
+
type FindResult = Schema & {
|
|
3288
|
+
custom_status?: string | CustomStatus.CustomStatusSchema;
|
|
3289
|
+
from: Warehouse.WarehouseSchema;
|
|
3290
|
+
to: Warehouse.WarehouseSchema;
|
|
3291
|
+
variants: {
|
|
3292
|
+
_id: string;
|
|
3293
|
+
variant_id: string;
|
|
3294
|
+
product_id: string;
|
|
3295
|
+
variant_name: string;
|
|
3296
|
+
product_name: string;
|
|
3297
|
+
qty: number;
|
|
3298
|
+
measure_unit_id?: string;
|
|
3299
|
+
measure_unit_name?: string;
|
|
3300
|
+
measure_unit_qty?: number;
|
|
3301
|
+
measure_unit_factor?: number;
|
|
3302
|
+
UpdatedAt: string;
|
|
3303
|
+
}[];
|
|
3304
|
+
};
|
|
3305
|
+
type GetResult = FindResult & {
|
|
3306
|
+
custom_status: CustomStatus.CustomStatusSchema & {
|
|
3307
|
+
variants: {
|
|
3308
|
+
_id: string;
|
|
3309
|
+
variant_id: string;
|
|
3310
|
+
product_id: string;
|
|
3311
|
+
variant_name: string;
|
|
3312
|
+
product_name: string;
|
|
3313
|
+
qty: number;
|
|
3314
|
+
measure_unit_id?: string;
|
|
3315
|
+
measure_unit_name?: string;
|
|
3316
|
+
measure_unit_qty?: number;
|
|
3317
|
+
measure_unit_factor?: number;
|
|
3318
|
+
UpdatedAt: string;
|
|
3319
|
+
qty_from_before?: number;
|
|
3320
|
+
qty_from_after?: number;
|
|
3321
|
+
qty_to_before?: number;
|
|
3322
|
+
qty_to_after?: number;
|
|
3323
|
+
}[];
|
|
3324
|
+
};
|
|
3325
|
+
};
|
|
3326
|
+
type TransferType = "load" | "unload";
|
|
3327
|
+
type PopulatedKeys = "custom_status";
|
|
3328
|
+
type TransferStatus =
|
|
3329
|
+
| "pending"
|
|
3330
|
+
| "approved"
|
|
3331
|
+
| "processing"
|
|
3332
|
+
| "rejected"
|
|
3333
|
+
| "processed";
|
|
3334
|
+
export namespace Find {
|
|
3335
|
+
export type Params = DefaultPaginationQueryParams & {
|
|
3336
|
+
_id?: string[] | string;
|
|
3337
|
+
"creator._id"?: string[] | string;
|
|
3338
|
+
"creator.name"?: string[] | string;
|
|
3339
|
+
"creator.type"?: string[] | string;
|
|
3340
|
+
type?: TransferType[] | TransferType;
|
|
3341
|
+
to?: string[] | string;
|
|
3342
|
+
from?: string[] | string;
|
|
3343
|
+
from_createdAt?: number;
|
|
3344
|
+
to_createdAt?: number;
|
|
3345
|
+
status?: TransferStatus | TransferStatus[];
|
|
3346
|
+
custom_status?: string[] | string;
|
|
3347
|
+
creator?: string[] | string;
|
|
3348
|
+
nodeCycles?: string[] | string;
|
|
3349
|
+
populatedKeys?: PopulatedKeys[];
|
|
3350
|
+
[key: string]: any; // integration_meta.
|
|
3351
|
+
};
|
|
3352
|
+
export interface Result extends DefaultPaginationResult {
|
|
3353
|
+
data: FindResult[];
|
|
3354
|
+
}
|
|
3355
|
+
}
|
|
3356
|
+
|
|
3357
|
+
export namespace Get {
|
|
3358
|
+
export type ID = string;
|
|
3359
|
+
export interface Params {
|
|
3360
|
+
populatedKeys?: PopulatedKeys[];
|
|
3361
|
+
withCycle?: boolean;
|
|
3362
|
+
}
|
|
3363
|
+
export type Result =
|
|
3364
|
+
| GetResult
|
|
3365
|
+
| {
|
|
3366
|
+
transfer: GetResult & {
|
|
3367
|
+
can_edit: boolean;
|
|
3368
|
+
current_nodes: string[];
|
|
3369
|
+
};
|
|
3370
|
+
cycle: Cycle.Schema;
|
|
3371
|
+
};
|
|
3372
|
+
}
|
|
3373
|
+
|
|
3374
|
+
export namespace Create {
|
|
3375
|
+
export type Body = CreateBody;
|
|
3376
|
+
export type Result = Schema;
|
|
3377
|
+
}
|
|
3378
|
+
|
|
3379
|
+
export namespace Update {
|
|
3380
|
+
export type ID = string;
|
|
3381
|
+
export type Body = UpdateBody;
|
|
3382
|
+
export type Result = Schema;
|
|
3383
|
+
}
|
|
3384
|
+
}
|
|
3385
|
+
|
|
3386
|
+
export namespace AdjustAccount {
|
|
3387
|
+
interface VariantOfAdjustAccount {
|
|
3388
|
+
variant: string;
|
|
3389
|
+
variant_name?: string;
|
|
3390
|
+
product_id?: string;
|
|
3391
|
+
product_name?: string;
|
|
3392
|
+
qty: number;
|
|
3393
|
+
}
|
|
3394
|
+
interface Schema {
|
|
3395
|
+
_id: string;
|
|
3396
|
+
serial_number: SerialNumber;
|
|
3397
|
+
time: number;
|
|
3398
|
+
creator: AdminCreator | RepCreator;
|
|
3399
|
+
from: string;
|
|
3400
|
+
to: string;
|
|
3401
|
+
variants: VariantOfAdjustAccount[];
|
|
3402
|
+
teams?: string[];
|
|
3403
|
+
sync_id: string;
|
|
3404
|
+
company_namespace: string[];
|
|
3405
|
+
createdAt: string;
|
|
3406
|
+
updatedAt: string;
|
|
3407
|
+
__v: number;
|
|
3408
|
+
}
|
|
3409
|
+
interface CreateBody {
|
|
3410
|
+
serial_number?: SerialNumber;
|
|
3411
|
+
time: number;
|
|
3412
|
+
creator?: AdminCreator | RepCreator;
|
|
3413
|
+
to: string;
|
|
3414
|
+
variants: VariantOfAdjustAccount[];
|
|
3415
|
+
teams?: string[];
|
|
3416
|
+
sync_id: string;
|
|
3417
|
+
company_namespace?: string[];
|
|
3418
|
+
}
|
|
3419
|
+
|
|
3420
|
+
type FindResult = Schema & {
|
|
3421
|
+
from: string | Warehouse.WarehouseSchema;
|
|
3422
|
+
to: string | Warehouse.WarehouseSchema;
|
|
3423
|
+
variants: (VariantOfAdjustAccount & {
|
|
3424
|
+
variant:
|
|
3425
|
+
| string
|
|
3426
|
+
| {
|
|
3427
|
+
_id: string;
|
|
3428
|
+
name: string;
|
|
3429
|
+
product: {
|
|
3430
|
+
_id: string;
|
|
3431
|
+
name: string;
|
|
3432
|
+
};
|
|
3433
|
+
};
|
|
3434
|
+
})[];
|
|
3435
|
+
};
|
|
3436
|
+
type GetResult = Schema & {
|
|
3437
|
+
from: string | Warehouse.WarehouseSchema;
|
|
3438
|
+
to: string | Warehouse.WarehouseSchema;
|
|
3439
|
+
variants: (VariantOfAdjustAccount & {
|
|
3440
|
+
variant: {
|
|
3441
|
+
_id: string;
|
|
3442
|
+
name: string;
|
|
3443
|
+
product: {
|
|
3444
|
+
_id: string;
|
|
3445
|
+
name: string;
|
|
3446
|
+
};
|
|
3447
|
+
};
|
|
3448
|
+
})[];
|
|
3449
|
+
};
|
|
3450
|
+
|
|
3451
|
+
type PopulatedKeys = "warehouse" | "variant";
|
|
3452
|
+
export namespace Find {
|
|
3453
|
+
export type Params = DefaultPaginationQueryParams & {
|
|
3454
|
+
_id?: string[] | string;
|
|
3455
|
+
"creator._id"?: string[] | string;
|
|
3456
|
+
"creator.name"?: string[] | string;
|
|
3457
|
+
"creator.type"?: string[] | string;
|
|
3458
|
+
to?: string[] | string;
|
|
3459
|
+
from?: string[] | string;
|
|
3460
|
+
from_createdAt?: number;
|
|
3461
|
+
to_createdAt?: number;
|
|
3462
|
+
creator?: string[] | string;
|
|
3463
|
+
populatedKeys?: PopulatedKeys[];
|
|
3464
|
+
};
|
|
3465
|
+
export interface Result extends DefaultPaginationResult {
|
|
3466
|
+
data: FindResult[];
|
|
3467
|
+
}
|
|
3468
|
+
}
|
|
3469
|
+
|
|
3470
|
+
export namespace Get {
|
|
3471
|
+
export type ID = string;
|
|
3472
|
+
export interface Params {
|
|
3473
|
+
populatedKeys?: PopulatedKeys[];
|
|
3474
|
+
}
|
|
3475
|
+
export type Result =
|
|
3476
|
+
| GetResult
|
|
3477
|
+
| {
|
|
3478
|
+
transfer: GetResult & {
|
|
3479
|
+
can_edit: boolean;
|
|
3480
|
+
current_nodes: string[];
|
|
3481
|
+
};
|
|
3482
|
+
cycle: Cycle.Schema;
|
|
3483
|
+
};
|
|
3484
|
+
}
|
|
3485
|
+
|
|
3486
|
+
export namespace Create {
|
|
3487
|
+
export type Body = CreateBody;
|
|
3488
|
+
export type Result = Schema;
|
|
3489
|
+
}
|
|
3490
|
+
}
|
|
3491
|
+
}
|