repzo 1.0.87 → 1.0.89
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/lib/index.d.ts +62 -0
- package/lib/index.js +125 -0
- package/lib/types/index.d.ts +1339 -13
- package/package.json +1 -1
- package/src/index.ts +162 -0
- package/src/types/index.ts +1294 -1
package/lib/types/index.d.ts
CHANGED
|
@@ -200,21 +200,21 @@ export interface Build {
|
|
|
200
200
|
list: List[];
|
|
201
201
|
start_date?: number | undefined;
|
|
202
202
|
}
|
|
203
|
-
export
|
|
203
|
+
export type Calendar = CalendarWeekly | CalendarWeeklyGroup;
|
|
204
204
|
export interface Route {
|
|
205
205
|
disabled: boolean;
|
|
206
206
|
list: List[];
|
|
207
207
|
_id: string;
|
|
208
208
|
}
|
|
209
|
-
export
|
|
210
|
-
export
|
|
209
|
+
export type Priority = 0 | 1 | 2 | 3;
|
|
210
|
+
export type WorkorderStatus =
|
|
211
211
|
| "open"
|
|
212
212
|
| "done"
|
|
213
213
|
| "cancelled"
|
|
214
214
|
| "inprogress"
|
|
215
215
|
| "onhold";
|
|
216
|
-
export
|
|
217
|
-
export
|
|
216
|
+
export type Priority_human = "none" | "low" | "medium" | "high";
|
|
217
|
+
export type Day =
|
|
218
218
|
| "Sun"
|
|
219
219
|
| "Mon"
|
|
220
220
|
| "Tue"
|
|
@@ -223,7 +223,7 @@ export declare type Day =
|
|
|
223
223
|
| "Fri"
|
|
224
224
|
| "Sat"
|
|
225
225
|
| string;
|
|
226
|
-
export
|
|
226
|
+
export type FieldType =
|
|
227
227
|
| "Text"
|
|
228
228
|
| "String"
|
|
229
229
|
| "Date"
|
|
@@ -269,7 +269,7 @@ export interface CalendarWeeklyGroup {
|
|
|
269
269
|
note?: string;
|
|
270
270
|
_id: string;
|
|
271
271
|
}
|
|
272
|
-
export
|
|
272
|
+
export type Model =
|
|
273
273
|
| "quickConvertToPdf"
|
|
274
274
|
| "warehouses"
|
|
275
275
|
| "transfers"
|
|
@@ -294,7 +294,7 @@ export declare type Model =
|
|
|
294
294
|
| "activities"
|
|
295
295
|
| "bigReports"
|
|
296
296
|
| "admins";
|
|
297
|
-
export
|
|
297
|
+
export type DocumentTypes =
|
|
298
298
|
| "form"
|
|
299
299
|
| "quickConvertToPdf"
|
|
300
300
|
| "clients"
|
|
@@ -338,7 +338,7 @@ export declare type DocumentTypes =
|
|
|
338
338
|
| "retailExecutionPreset"
|
|
339
339
|
| "paymentMethod"
|
|
340
340
|
| "approvalRequest";
|
|
341
|
-
export
|
|
341
|
+
export type PrintTypes = "workorder" | "form" | "invoice" | "proforma";
|
|
342
342
|
export interface MediaDoc {
|
|
343
343
|
_id?: string;
|
|
344
344
|
media_id: string;
|
|
@@ -4678,11 +4678,21 @@ export declare namespace Service {
|
|
|
4678
4678
|
assets_populated?: AssetsPopulated[];
|
|
4679
4679
|
asset_part_units_populated?: (Pick<
|
|
4680
4680
|
AssetPartUnit.Data,
|
|
4681
|
-
|
|
4681
|
+
| "_id"
|
|
4682
|
+
| "asset_part"
|
|
4683
|
+
| "custom_status"
|
|
4684
|
+
| "qty"
|
|
4685
|
+
| "directional_status"
|
|
4686
|
+
| "warehouse"
|
|
4687
|
+
| "warehouse_name"
|
|
4682
4688
|
> & {
|
|
4683
4689
|
asset_part: Pick<AssetPart.Data, "_id" | "name" | "local_name"> & {
|
|
4684
4690
|
cover_photo?: PopulatedMediaStorage[];
|
|
4685
4691
|
};
|
|
4692
|
+
custom_status?: Pick<
|
|
4693
|
+
CustomStatus.CustomStatusSchema,
|
|
4694
|
+
"_id" | "code" | "color" | "local_name" | "name"
|
|
4695
|
+
>;
|
|
4686
4696
|
})[];
|
|
4687
4697
|
assigned_to_populated?: RepresentativesPopulated;
|
|
4688
4698
|
client_location_populated?: ClientLocationPopulated;
|
|
@@ -9230,9 +9240,1325 @@ export declare namespace Service {
|
|
|
9230
9240
|
};
|
|
9231
9241
|
}
|
|
9232
9242
|
}
|
|
9243
|
+
namespace Cart {
|
|
9244
|
+
type Promo = Promotion.Schema & {
|
|
9245
|
+
details: Promotion.Schema["details"] & {
|
|
9246
|
+
promotions_enabled?: boolean;
|
|
9247
|
+
};
|
|
9248
|
+
applied: {
|
|
9249
|
+
doesApply: boolean;
|
|
9250
|
+
appliedCount: number;
|
|
9251
|
+
limit_reached: boolean;
|
|
9252
|
+
is_prospective: boolean;
|
|
9253
|
+
rounds_status: ("full" | "partial" | "none")[];
|
|
9254
|
+
last_round_buy_success: boolean;
|
|
9255
|
+
used: boolean;
|
|
9256
|
+
bulk_get_limit_values: number[];
|
|
9257
|
+
};
|
|
9258
|
+
promoApplicableCount: number;
|
|
9259
|
+
};
|
|
9260
|
+
interface Data {
|
|
9261
|
+
_id: StringId;
|
|
9262
|
+
type: "invoice" | "proforma";
|
|
9263
|
+
processable?: boolean;
|
|
9264
|
+
failure_reasons: string[];
|
|
9265
|
+
external_serial_number?: string;
|
|
9266
|
+
qr_code_tlv?: string;
|
|
9267
|
+
skip_promos?: boolean;
|
|
9268
|
+
skipped_promotions: {
|
|
9269
|
+
_id: string;
|
|
9270
|
+
name: string;
|
|
9271
|
+
ref: string;
|
|
9272
|
+
}[];
|
|
9273
|
+
client_id: StringId;
|
|
9274
|
+
client_name: string;
|
|
9275
|
+
comment?: string;
|
|
9276
|
+
return_comment?: string;
|
|
9277
|
+
creator: {
|
|
9278
|
+
_id: string;
|
|
9279
|
+
type: "rep" | "client" | "admin";
|
|
9280
|
+
rep?: string;
|
|
9281
|
+
admin?: string;
|
|
9282
|
+
client?: string;
|
|
9283
|
+
name?: string;
|
|
9284
|
+
};
|
|
9285
|
+
implemented_by?: {
|
|
9286
|
+
_id: string;
|
|
9287
|
+
type: "rep" | "client" | "admin";
|
|
9288
|
+
rep?: string;
|
|
9289
|
+
admin?: string;
|
|
9290
|
+
client?: string;
|
|
9291
|
+
name?: string;
|
|
9292
|
+
};
|
|
9293
|
+
latest: boolean;
|
|
9294
|
+
version?: number;
|
|
9295
|
+
time?: number;
|
|
9296
|
+
issue_date: string;
|
|
9297
|
+
delivery_date?: string;
|
|
9298
|
+
currency: string;
|
|
9299
|
+
serial_number?: SerialNumber;
|
|
9300
|
+
geo_tag: {
|
|
9301
|
+
type: "Point";
|
|
9302
|
+
coordinates: number[];
|
|
9303
|
+
};
|
|
9304
|
+
sync_id: string;
|
|
9305
|
+
address?: {
|
|
9306
|
+
[key: string]: any;
|
|
9307
|
+
};
|
|
9308
|
+
company_namespace: string[];
|
|
9309
|
+
promotions: Promo[];
|
|
9310
|
+
priceLists: PriceListItem.PriceListItemSchema[];
|
|
9311
|
+
visit_id?: string;
|
|
9312
|
+
teams: string[];
|
|
9313
|
+
converter?: {
|
|
9314
|
+
_id: string;
|
|
9315
|
+
type: "rep" | "client" | "admin";
|
|
9316
|
+
rep?: string;
|
|
9317
|
+
admin?: string;
|
|
9318
|
+
client?: string;
|
|
9319
|
+
name?: string;
|
|
9320
|
+
};
|
|
9321
|
+
converted_proforma_serial_number?: SerialNumber;
|
|
9322
|
+
converted_proforma_return_serial_number?: SerialNumber;
|
|
9323
|
+
proforma_reference?: string;
|
|
9324
|
+
converted_at?: number;
|
|
9325
|
+
exclude_return_items?: boolean;
|
|
9326
|
+
returned_from?: string;
|
|
9327
|
+
returned_to?: string;
|
|
9328
|
+
returned_from_serial_number?: SerialNumber;
|
|
9329
|
+
returned_to_serial_number?: SerialNumber;
|
|
9330
|
+
due_date?: string;
|
|
9331
|
+
return_serial_number?: SerialNumber;
|
|
9332
|
+
origin_warehouse?: string;
|
|
9333
|
+
msl_sales?: string;
|
|
9334
|
+
route?: string;
|
|
9335
|
+
paymentsData: {
|
|
9336
|
+
invoice_value: number;
|
|
9337
|
+
paid: number;
|
|
9338
|
+
balance: number;
|
|
9339
|
+
payments: {
|
|
9340
|
+
payment_serial_number?: SerialNumber;
|
|
9341
|
+
payment_id?: string;
|
|
9342
|
+
invoice_serial_number?: SerialNumber;
|
|
9343
|
+
return_serial_number?: SerialNumber;
|
|
9344
|
+
fullinvoice_id?: string;
|
|
9345
|
+
view_serial_number?: SerialNumber;
|
|
9346
|
+
type: "invoice" | "payment" | "return_invoice";
|
|
9347
|
+
amount: number;
|
|
9348
|
+
}[];
|
|
9349
|
+
};
|
|
9350
|
+
consumption: {
|
|
9351
|
+
status: "consumed" | "unconsumed" | "partially_consumed";
|
|
9352
|
+
remainder: number;
|
|
9353
|
+
};
|
|
9354
|
+
subtotal?: number;
|
|
9355
|
+
discount_amount?: number;
|
|
9356
|
+
discount_amount_float?: number;
|
|
9357
|
+
taxable_subtotal?: number;
|
|
9358
|
+
net_total?: number;
|
|
9359
|
+
tax_amount?: number;
|
|
9360
|
+
tax_amount_after_deduction_float?: number;
|
|
9361
|
+
tax_amount_after_deduction_float_rounded_sum?: number;
|
|
9362
|
+
tax_amount_after_deduction_float_rounded?: number;
|
|
9363
|
+
total?: number;
|
|
9364
|
+
total_float?: number;
|
|
9365
|
+
total_float_rounded?: number;
|
|
9366
|
+
total_float_rounded_sum?: number;
|
|
9367
|
+
total_before_tax?: number;
|
|
9368
|
+
taxable_amount_float?: number;
|
|
9369
|
+
taxable_amount_float_rounded_sum?: number;
|
|
9370
|
+
taxable_amount_float_rounded?: number;
|
|
9371
|
+
pre_subtotal?: number;
|
|
9372
|
+
pre_discount_amount?: number;
|
|
9373
|
+
pre_discount_amount_float?: number;
|
|
9374
|
+
pre_taxable_subtotal?: number;
|
|
9375
|
+
pre_net_total?: number;
|
|
9376
|
+
pre_tax_amount?: number;
|
|
9377
|
+
pre_tax_amount_after_deduction_float?: number;
|
|
9378
|
+
pre_tax_amount_after_deduction_float_rounded?: number;
|
|
9379
|
+
pre_tax_amount_after_deduction_float_rounded_sum?: number;
|
|
9380
|
+
pre_total?: number;
|
|
9381
|
+
pre_total_float?: number;
|
|
9382
|
+
pre_total_float_rounded?: number;
|
|
9383
|
+
pre_total_float_rounded_sum?: number;
|
|
9384
|
+
pre_total_before_tax?: number;
|
|
9385
|
+
pre_taxable_amount_float?: number;
|
|
9386
|
+
pre_taxable_amount_float_rounded?: number;
|
|
9387
|
+
pre_taxable_amount_float_rounded_sum?: number;
|
|
9388
|
+
return_subtotal?: number;
|
|
9389
|
+
return_discount_amount?: number;
|
|
9390
|
+
return_discount_amount_float?: number;
|
|
9391
|
+
return_taxable_subtotal?: number;
|
|
9392
|
+
return_net_total?: number;
|
|
9393
|
+
return_tax_amount?: number;
|
|
9394
|
+
return_tax_amount_after_deduction_float?: number;
|
|
9395
|
+
return_tax_amount_after_deduction_float_rounded?: number;
|
|
9396
|
+
return_tax_amount_after_deduction_float_rounded_sum?: number;
|
|
9397
|
+
return_total?: number;
|
|
9398
|
+
return_total_float?: number;
|
|
9399
|
+
return_total_float_rounded?: number;
|
|
9400
|
+
return_total_float_rounded_sum?: number;
|
|
9401
|
+
return_total_before_tax?: number;
|
|
9402
|
+
return_taxable_amount_float?: number;
|
|
9403
|
+
return_taxable_amount_float_rounded?: number;
|
|
9404
|
+
return_taxable_amount_float_rounded_sum?: number;
|
|
9405
|
+
deductionRatio?: number;
|
|
9406
|
+
deductionFixed?: number;
|
|
9407
|
+
totalDeductedTax?: number;
|
|
9408
|
+
totalDeductedTaxFloat?: number;
|
|
9409
|
+
totalDeduction?: number;
|
|
9410
|
+
totalDeductionFloat?: number;
|
|
9411
|
+
totalDeductionBeforeTax?: number;
|
|
9412
|
+
totalDeductionBeforeTaxFloat?: number;
|
|
9413
|
+
totalAfterDeduction?: number;
|
|
9414
|
+
totalAfterDeductionFloat?: number;
|
|
9415
|
+
lines_discount?: number;
|
|
9416
|
+
lines_discount_float?: number;
|
|
9417
|
+
taxes: {
|
|
9418
|
+
[key: string]: any;
|
|
9419
|
+
};
|
|
9420
|
+
overwriteDeductionFixed?: number;
|
|
9421
|
+
overwriteTaxExempt?: boolean;
|
|
9422
|
+
tax_exempt?: boolean;
|
|
9423
|
+
overwriteDeductionRatio?: number;
|
|
9424
|
+
shipping_zone?: {
|
|
9425
|
+
[key: string]: any;
|
|
9426
|
+
};
|
|
9427
|
+
payment_method?: {
|
|
9428
|
+
[key: string]: any;
|
|
9429
|
+
};
|
|
9430
|
+
shipping_price?: number;
|
|
9431
|
+
shipping_tax?: number;
|
|
9432
|
+
shipping_charge?: number;
|
|
9433
|
+
payment_charge?: number;
|
|
9434
|
+
total_with_charges?: number;
|
|
9435
|
+
payment?: {
|
|
9436
|
+
amount?: number;
|
|
9437
|
+
};
|
|
9438
|
+
workorder?: string;
|
|
9439
|
+
asset?: string;
|
|
9440
|
+
asset_unit?: string;
|
|
9441
|
+
signature?: string;
|
|
9442
|
+
createdAt: Date;
|
|
9443
|
+
updatedAt: Date;
|
|
9444
|
+
items: (Item.Schema & {
|
|
9445
|
+
notes?: {
|
|
9446
|
+
[key: string]: any;
|
|
9447
|
+
};
|
|
9448
|
+
})[];
|
|
9449
|
+
return_items?: (Item.Schema & {
|
|
9450
|
+
notes?: {
|
|
9451
|
+
[key: string]: any;
|
|
9452
|
+
};
|
|
9453
|
+
})[];
|
|
9454
|
+
invoice_payment_type: "cash" | "credit";
|
|
9455
|
+
total_items_base_unit_qty?: number;
|
|
9456
|
+
total_items_qty?: number;
|
|
9457
|
+
total_return_items_base_unit_qty?: number;
|
|
9458
|
+
total_return_items_qty?: number;
|
|
9459
|
+
cart?: {
|
|
9460
|
+
[key: string]: any;
|
|
9461
|
+
};
|
|
9462
|
+
__v?: number;
|
|
9463
|
+
}
|
|
9464
|
+
interface CreateBody {
|
|
9465
|
+
type: "invoice" | "proforma";
|
|
9466
|
+
processable?: boolean;
|
|
9467
|
+
failure_reasons: string[];
|
|
9468
|
+
external_serial_number?: string;
|
|
9469
|
+
skip_promos?: boolean;
|
|
9470
|
+
skipped_promotions: {
|
|
9471
|
+
_id: string;
|
|
9472
|
+
name: string;
|
|
9473
|
+
ref: string;
|
|
9474
|
+
}[];
|
|
9475
|
+
client_id: StringId;
|
|
9476
|
+
client_name: string;
|
|
9477
|
+
comment?: string;
|
|
9478
|
+
return_comment?: string;
|
|
9479
|
+
creator: {
|
|
9480
|
+
_id: string;
|
|
9481
|
+
type: "rep" | "client" | "admin";
|
|
9482
|
+
rep?: string;
|
|
9483
|
+
admin?: string;
|
|
9484
|
+
client?: string;
|
|
9485
|
+
name?: string;
|
|
9486
|
+
};
|
|
9487
|
+
implemented_by?: {
|
|
9488
|
+
_id: string;
|
|
9489
|
+
type: "rep" | "client" | "admin";
|
|
9490
|
+
rep?: string;
|
|
9491
|
+
admin?: string;
|
|
9492
|
+
client?: string;
|
|
9493
|
+
name?: string;
|
|
9494
|
+
};
|
|
9495
|
+
latest: boolean;
|
|
9496
|
+
version?: number;
|
|
9497
|
+
time?: number;
|
|
9498
|
+
issue_date: string;
|
|
9499
|
+
delivery_date?: string;
|
|
9500
|
+
currency: string;
|
|
9501
|
+
serial_number?: SerialNumber;
|
|
9502
|
+
geo_tag: {
|
|
9503
|
+
type: "Point";
|
|
9504
|
+
coordinates: number[];
|
|
9505
|
+
};
|
|
9506
|
+
sync_id: string;
|
|
9507
|
+
address?: {
|
|
9508
|
+
[key: string]: any;
|
|
9509
|
+
};
|
|
9510
|
+
company_namespace: string[];
|
|
9511
|
+
promotions: Promo[];
|
|
9512
|
+
priceLists: PriceListItem.PriceListItemSchema[];
|
|
9513
|
+
visit_id?: string;
|
|
9514
|
+
teams: string[];
|
|
9515
|
+
converter?: {
|
|
9516
|
+
_id: string;
|
|
9517
|
+
type: "rep" | "client" | "admin";
|
|
9518
|
+
rep?: string;
|
|
9519
|
+
admin?: string;
|
|
9520
|
+
client?: string;
|
|
9521
|
+
name?: string;
|
|
9522
|
+
};
|
|
9523
|
+
converted_proforma_serial_number?: SerialNumber;
|
|
9524
|
+
converted_proforma_return_serial_number?: SerialNumber;
|
|
9525
|
+
proforma_reference?: string;
|
|
9526
|
+
converted_at?: number;
|
|
9527
|
+
exclude_return_items?: boolean;
|
|
9528
|
+
returned_from?: string;
|
|
9529
|
+
returned_to?: string;
|
|
9530
|
+
returned_from_serial_number?: SerialNumber;
|
|
9531
|
+
returned_to_serial_number?: SerialNumber;
|
|
9532
|
+
due_date?: string;
|
|
9533
|
+
return_serial_number?: SerialNumber;
|
|
9534
|
+
origin_warehouse?: string;
|
|
9535
|
+
msl_sales?: string;
|
|
9536
|
+
route?: string;
|
|
9537
|
+
paymentsData: {
|
|
9538
|
+
invoice_value: number;
|
|
9539
|
+
paid: number;
|
|
9540
|
+
balance: number;
|
|
9541
|
+
payments: {
|
|
9542
|
+
payment_serial_number?: SerialNumber;
|
|
9543
|
+
payment_id?: string;
|
|
9544
|
+
invoice_serial_number?: SerialNumber;
|
|
9545
|
+
return_serial_number?: SerialNumber;
|
|
9546
|
+
fullinvoice_id?: string;
|
|
9547
|
+
view_serial_number?: SerialNumber;
|
|
9548
|
+
type: "invoice" | "payment" | "return_invoice";
|
|
9549
|
+
amount: number;
|
|
9550
|
+
}[];
|
|
9551
|
+
};
|
|
9552
|
+
consumption: {
|
|
9553
|
+
status: "consumed" | "unconsumed" | "partially_consumed";
|
|
9554
|
+
remainder: number;
|
|
9555
|
+
};
|
|
9556
|
+
subtotal?: number;
|
|
9557
|
+
discount_amount?: number;
|
|
9558
|
+
discount_amount_float?: number;
|
|
9559
|
+
taxable_subtotal?: number;
|
|
9560
|
+
net_total?: number;
|
|
9561
|
+
tax_amount?: number;
|
|
9562
|
+
tax_amount_after_deduction_float?: number;
|
|
9563
|
+
tax_amount_after_deduction_float_rounded_sum?: number;
|
|
9564
|
+
tax_amount_after_deduction_float_rounded?: number;
|
|
9565
|
+
total?: number;
|
|
9566
|
+
total_float?: number;
|
|
9567
|
+
total_float_rounded?: number;
|
|
9568
|
+
total_float_rounded_sum?: number;
|
|
9569
|
+
total_before_tax?: number;
|
|
9570
|
+
taxable_amount_float?: number;
|
|
9571
|
+
taxable_amount_float_rounded_sum?: number;
|
|
9572
|
+
taxable_amount_float_rounded?: number;
|
|
9573
|
+
pre_subtotal?: number;
|
|
9574
|
+
pre_discount_amount?: number;
|
|
9575
|
+
pre_discount_amount_float?: number;
|
|
9576
|
+
pre_taxable_subtotal?: number;
|
|
9577
|
+
pre_net_total?: number;
|
|
9578
|
+
pre_tax_amount?: number;
|
|
9579
|
+
pre_tax_amount_after_deduction_float?: number;
|
|
9580
|
+
pre_tax_amount_after_deduction_float_rounded?: number;
|
|
9581
|
+
pre_tax_amount_after_deduction_float_rounded_sum?: number;
|
|
9582
|
+
pre_total?: number;
|
|
9583
|
+
pre_total_float?: number;
|
|
9584
|
+
pre_total_float_rounded?: number;
|
|
9585
|
+
pre_total_float_rounded_sum?: number;
|
|
9586
|
+
pre_total_before_tax?: number;
|
|
9587
|
+
pre_taxable_amount_float?: number;
|
|
9588
|
+
pre_taxable_amount_float_rounded?: number;
|
|
9589
|
+
pre_taxable_amount_float_rounded_sum?: number;
|
|
9590
|
+
return_subtotal?: number;
|
|
9591
|
+
return_discount_amount?: number;
|
|
9592
|
+
return_discount_amount_float?: number;
|
|
9593
|
+
return_taxable_subtotal?: number;
|
|
9594
|
+
return_net_total?: number;
|
|
9595
|
+
return_tax_amount?: number;
|
|
9596
|
+
return_tax_amount_after_deduction_float?: number;
|
|
9597
|
+
return_tax_amount_after_deduction_float_rounded?: number;
|
|
9598
|
+
return_tax_amount_after_deduction_float_rounded_sum?: number;
|
|
9599
|
+
return_total?: number;
|
|
9600
|
+
return_total_float?: number;
|
|
9601
|
+
return_total_float_rounded?: number;
|
|
9602
|
+
return_total_float_rounded_sum?: number;
|
|
9603
|
+
return_total_before_tax?: number;
|
|
9604
|
+
return_taxable_amount_float?: number;
|
|
9605
|
+
return_taxable_amount_float_rounded?: number;
|
|
9606
|
+
return_taxable_amount_float_rounded_sum?: number;
|
|
9607
|
+
deductionRatio?: number;
|
|
9608
|
+
deductionFixed?: number;
|
|
9609
|
+
totalDeductedTax?: number;
|
|
9610
|
+
totalDeductedTaxFloat?: number;
|
|
9611
|
+
totalDeduction?: number;
|
|
9612
|
+
totalDeductionFloat?: number;
|
|
9613
|
+
totalDeductionBeforeTax?: number;
|
|
9614
|
+
totalDeductionBeforeTaxFloat?: number;
|
|
9615
|
+
totalAfterDeduction?: number;
|
|
9616
|
+
totalAfterDeductionFloat?: number;
|
|
9617
|
+
lines_discount?: number;
|
|
9618
|
+
lines_discount_float?: number;
|
|
9619
|
+
taxes: {
|
|
9620
|
+
[key: string]: any;
|
|
9621
|
+
};
|
|
9622
|
+
overwriteDeductionFixed?: number;
|
|
9623
|
+
overwriteTaxExempt?: boolean;
|
|
9624
|
+
tax_exempt?: boolean;
|
|
9625
|
+
overwriteDeductionRatio?: number;
|
|
9626
|
+
shipping_zone?: {
|
|
9627
|
+
[key: string]: any;
|
|
9628
|
+
};
|
|
9629
|
+
payment_method?: {
|
|
9630
|
+
[key: string]: any;
|
|
9631
|
+
};
|
|
9632
|
+
shipping_price?: number;
|
|
9633
|
+
shipping_tax?: number;
|
|
9634
|
+
shipping_charge?: number;
|
|
9635
|
+
payment_charge?: number;
|
|
9636
|
+
total_with_charges?: number;
|
|
9637
|
+
payment?: {
|
|
9638
|
+
amount?: number;
|
|
9639
|
+
};
|
|
9640
|
+
workorder?: string;
|
|
9641
|
+
asset?: string;
|
|
9642
|
+
asset_unit?: string;
|
|
9643
|
+
signature?: string;
|
|
9644
|
+
createdAt: Date;
|
|
9645
|
+
updatedAt: Date;
|
|
9646
|
+
items: (Item.Schema & {
|
|
9647
|
+
notes?: {
|
|
9648
|
+
[key: string]: any;
|
|
9649
|
+
};
|
|
9650
|
+
})[];
|
|
9651
|
+
return_items?: (Item.Schema & {
|
|
9652
|
+
notes?: {
|
|
9653
|
+
[key: string]: any;
|
|
9654
|
+
};
|
|
9655
|
+
})[];
|
|
9656
|
+
invoice_payment_type: "cash" | "credit";
|
|
9657
|
+
total_items_base_unit_qty?: number;
|
|
9658
|
+
total_items_qty?: number;
|
|
9659
|
+
total_return_items_base_unit_qty?: number;
|
|
9660
|
+
total_return_items_qty?: number;
|
|
9661
|
+
cart?: {
|
|
9662
|
+
[key: string]: any;
|
|
9663
|
+
};
|
|
9664
|
+
}
|
|
9665
|
+
namespace Find {
|
|
9666
|
+
type Params = DefaultPaginationQueryParams & {
|
|
9667
|
+
client_id?: string;
|
|
9668
|
+
type?: string;
|
|
9669
|
+
};
|
|
9670
|
+
interface Result extends DefaultPaginationResult {
|
|
9671
|
+
data: Data[];
|
|
9672
|
+
}
|
|
9673
|
+
}
|
|
9674
|
+
namespace Get {
|
|
9675
|
+
type ID = string;
|
|
9676
|
+
type Result = Data;
|
|
9677
|
+
}
|
|
9678
|
+
namespace Create {
|
|
9679
|
+
type Body = CreateBody;
|
|
9680
|
+
type Result = Data;
|
|
9681
|
+
}
|
|
9682
|
+
}
|
|
9683
|
+
namespace OcrInvoiceJobTemplate {
|
|
9684
|
+
interface ProductMatchStage {
|
|
9685
|
+
model: "products" | "productvariations" | "ocrInvoiceJobPages";
|
|
9686
|
+
model_key:
|
|
9687
|
+
| "name"
|
|
9688
|
+
| "barcode"
|
|
9689
|
+
| "sku"
|
|
9690
|
+
| "ai_json_data.barcode"
|
|
9691
|
+
| "ai_json_data.code"
|
|
9692
|
+
| "ai_json_data.description";
|
|
9693
|
+
operator: "eq";
|
|
9694
|
+
ai_json_key: "barcode" | "code" | "description";
|
|
9695
|
+
condition: "learn_ignorance";
|
|
9696
|
+
warning_message: string;
|
|
9697
|
+
is_warning: boolean;
|
|
9698
|
+
}
|
|
9699
|
+
interface MeasureUnitMatchStage {
|
|
9700
|
+
model: "measureunits";
|
|
9701
|
+
quick_action: "product_default" | "base_measure_unit";
|
|
9702
|
+
condition: "eq_product_default" | "in_product_family";
|
|
9703
|
+
model_key: "name";
|
|
9704
|
+
operator: "eq";
|
|
9705
|
+
ai_json_key: "measure_unit";
|
|
9706
|
+
warning_message: string;
|
|
9707
|
+
is_warning: boolean;
|
|
9708
|
+
}
|
|
9709
|
+
interface ClientMatchingStage {
|
|
9710
|
+
model: "clients" | "ocrInvoiceJobPages";
|
|
9711
|
+
condition?: "in_current_template";
|
|
9712
|
+
model_key: "name" | "ai_invoice_json.client_name";
|
|
9713
|
+
operator: "eq";
|
|
9714
|
+
ai_json_key: "client_name";
|
|
9715
|
+
warning_message?: string;
|
|
9716
|
+
is_warning?: boolean;
|
|
9717
|
+
}
|
|
9718
|
+
interface CartOptions {
|
|
9719
|
+
overwrite_price: boolean;
|
|
9720
|
+
client_override?: boolean;
|
|
9721
|
+
product_matching_stages: ProductMatchStage[];
|
|
9722
|
+
measure_unit_matching_stages: MeasureUnitMatchStage[];
|
|
9723
|
+
client_matching_stages: ClientMatchingStage[];
|
|
9724
|
+
}
|
|
9725
|
+
interface Data {
|
|
9726
|
+
_id: StringId;
|
|
9727
|
+
name: string;
|
|
9728
|
+
company_namespace: string[];
|
|
9729
|
+
disabled: boolean;
|
|
9730
|
+
document_scan_listed: boolean;
|
|
9731
|
+
client?: StringId;
|
|
9732
|
+
doc_type: "pdf" | "image";
|
|
9733
|
+
preparation_option?: {
|
|
9734
|
+
rotate?: boolean;
|
|
9735
|
+
convert_to_image: boolean;
|
|
9736
|
+
lang?: {
|
|
9737
|
+
en?: boolean;
|
|
9738
|
+
ar?: boolean;
|
|
9739
|
+
};
|
|
9740
|
+
};
|
|
9741
|
+
cart_option?: CartOptions;
|
|
9742
|
+
ai_json_parsing_model: "gpt-4o-mini" | "gpt-4o";
|
|
9743
|
+
ai_vision_model: "gpt-4o-mini" | "gpt-4o" | "local_vision";
|
|
9744
|
+
visible_columns: {
|
|
9745
|
+
key:
|
|
9746
|
+
| "product_name"
|
|
9747
|
+
| "variant_name"
|
|
9748
|
+
| "product_sku"
|
|
9749
|
+
| "product_barcode"
|
|
9750
|
+
| "variant_barcode"
|
|
9751
|
+
| "variant_sku"
|
|
9752
|
+
| "price"
|
|
9753
|
+
| "qty"
|
|
9754
|
+
| "measure_unit"
|
|
9755
|
+
| "total_amount"
|
|
9756
|
+
| "total"
|
|
9757
|
+
| "code";
|
|
9758
|
+
visible: boolean;
|
|
9759
|
+
}[];
|
|
9760
|
+
ai_parsing_prompt_amendment?: string;
|
|
9761
|
+
ai_vision_prompt_amendment?: string;
|
|
9762
|
+
ai_parsing_prompt_overwrite?: string;
|
|
9763
|
+
ai_vision_prompt_overwrite?: string;
|
|
9764
|
+
enable_ai_parsing_prompt_amendment?: boolean;
|
|
9765
|
+
enable_ai_vision_prompt_amendment?: boolean;
|
|
9766
|
+
enable_ai_parsing_prompt_overwrite?: boolean;
|
|
9767
|
+
enable_ai_vision_prompt_overwrite?: boolean;
|
|
9768
|
+
always_merge_pages_for_job?: boolean;
|
|
9769
|
+
trim_barcode_zero_from_left?: boolean;
|
|
9770
|
+
createdAt: Date;
|
|
9771
|
+
updatedAt: Date;
|
|
9772
|
+
}
|
|
9773
|
+
interface PopulatedDoc {
|
|
9774
|
+
_id: StringId;
|
|
9775
|
+
name: string;
|
|
9776
|
+
company_namespace: string[];
|
|
9777
|
+
disabled: boolean;
|
|
9778
|
+
document_scan_listed: boolean;
|
|
9779
|
+
client?: StringId;
|
|
9780
|
+
client_populated?: Pick<Client.ClientSchema, "name" | "_id">;
|
|
9781
|
+
doc_type: "pdf" | "image";
|
|
9782
|
+
preparation_option?: {
|
|
9783
|
+
rotate?: boolean;
|
|
9784
|
+
convert_to_image: boolean;
|
|
9785
|
+
lang?: {
|
|
9786
|
+
en?: boolean;
|
|
9787
|
+
ar?: boolean;
|
|
9788
|
+
};
|
|
9789
|
+
};
|
|
9790
|
+
cart_option?: CartOptions;
|
|
9791
|
+
ai_json_parsing_model: "gpt-4o-mini" | "gpt-4o";
|
|
9792
|
+
ai_vision_model: "gpt-4o-mini" | "gpt-4o" | "local_vision";
|
|
9793
|
+
visible_columns: {
|
|
9794
|
+
key:
|
|
9795
|
+
| "product_name"
|
|
9796
|
+
| "variant_name"
|
|
9797
|
+
| "product_sku"
|
|
9798
|
+
| "product_barcode"
|
|
9799
|
+
| "variant_barcode"
|
|
9800
|
+
| "variant_sku"
|
|
9801
|
+
| "price"
|
|
9802
|
+
| "qty"
|
|
9803
|
+
| "measure_unit"
|
|
9804
|
+
| "total_amount"
|
|
9805
|
+
| "total"
|
|
9806
|
+
| "code";
|
|
9807
|
+
visible: boolean;
|
|
9808
|
+
}[];
|
|
9809
|
+
ai_parsing_prompt_amendment?: string;
|
|
9810
|
+
ai_vision_prompt_amendment?: string;
|
|
9811
|
+
ai_parsing_prompt_overwrite?: string;
|
|
9812
|
+
ai_vision_prompt_overwrite?: string;
|
|
9813
|
+
enable_ai_parsing_prompt_amendment?: boolean;
|
|
9814
|
+
enable_ai_vision_prompt_amendment?: boolean;
|
|
9815
|
+
enable_ai_parsing_prompt_overwrite?: boolean;
|
|
9816
|
+
enable_ai_vision_prompt_overwrite?: boolean;
|
|
9817
|
+
always_merge_pages_for_job?: boolean;
|
|
9818
|
+
trim_zero_from_first?: boolean;
|
|
9819
|
+
createdAt: Date;
|
|
9820
|
+
updatedAt: Date;
|
|
9821
|
+
}
|
|
9822
|
+
interface CreateBody {
|
|
9823
|
+
name: string;
|
|
9824
|
+
company_namespace: string[];
|
|
9825
|
+
document_scan_listed: boolean;
|
|
9826
|
+
client?: StringId;
|
|
9827
|
+
doc_type: "pdf" | "image";
|
|
9828
|
+
preparation_option?: {
|
|
9829
|
+
rotate?: boolean;
|
|
9830
|
+
convert_to_image: boolean;
|
|
9831
|
+
lang?: {
|
|
9832
|
+
en?: boolean;
|
|
9833
|
+
ar?: boolean;
|
|
9834
|
+
};
|
|
9835
|
+
};
|
|
9836
|
+
cart_option?: CartOptions;
|
|
9837
|
+
ai_json_parsing_model: "gpt-4o-mini" | "gpt-4o";
|
|
9838
|
+
ai_vision_model: "gpt-4o-mini" | "gpt-4o" | "local_vision";
|
|
9839
|
+
visible_columns: {
|
|
9840
|
+
key:
|
|
9841
|
+
| "product_name"
|
|
9842
|
+
| "variant_name"
|
|
9843
|
+
| "product_sku"
|
|
9844
|
+
| "product_barcode"
|
|
9845
|
+
| "variant_barcode"
|
|
9846
|
+
| "variant_sku"
|
|
9847
|
+
| "price"
|
|
9848
|
+
| "qty"
|
|
9849
|
+
| "measure_unit"
|
|
9850
|
+
| "total_amount"
|
|
9851
|
+
| "total"
|
|
9852
|
+
| "code";
|
|
9853
|
+
visible: boolean;
|
|
9854
|
+
}[];
|
|
9855
|
+
ai_parsing_prompt_amendment?: string;
|
|
9856
|
+
ai_vision_prompt_amendment?: string;
|
|
9857
|
+
ai_parsing_prompt_overwrite?: string;
|
|
9858
|
+
ai_vision_prompt_overwrite?: string;
|
|
9859
|
+
enable_ai_parsing_prompt_amendment?: boolean;
|
|
9860
|
+
enable_ai_vision_prompt_amendment?: boolean;
|
|
9861
|
+
enable_ai_parsing_prompt_overwrite?: boolean;
|
|
9862
|
+
enable_ai_vision_prompt_overwrite?: boolean;
|
|
9863
|
+
always_merge_pages_for_job?: boolean;
|
|
9864
|
+
trim_zero_from_first?: boolean;
|
|
9865
|
+
}
|
|
9866
|
+
interface UpdateBody {
|
|
9867
|
+
name: string;
|
|
9868
|
+
company_namespace: string[];
|
|
9869
|
+
document_scan_listed: boolean;
|
|
9870
|
+
client?: StringId;
|
|
9871
|
+
preparation_option?: {
|
|
9872
|
+
rotate?: boolean;
|
|
9873
|
+
convert_to_image: boolean;
|
|
9874
|
+
lang?: {
|
|
9875
|
+
en?: boolean;
|
|
9876
|
+
ar?: boolean;
|
|
9877
|
+
};
|
|
9878
|
+
};
|
|
9879
|
+
cart_option?: CartOptions;
|
|
9880
|
+
ai_json_parsing_model: "gpt-4o-mini" | "gpt-4o";
|
|
9881
|
+
ai_vision_model: "gpt-4o-mini" | "gpt-4o" | "local_vision";
|
|
9882
|
+
visible_columns: {
|
|
9883
|
+
key:
|
|
9884
|
+
| "product_name"
|
|
9885
|
+
| "variant_name"
|
|
9886
|
+
| "product_sku"
|
|
9887
|
+
| "product_barcode"
|
|
9888
|
+
| "variant_barcode"
|
|
9889
|
+
| "variant_sku"
|
|
9890
|
+
| "price"
|
|
9891
|
+
| "qty"
|
|
9892
|
+
| "measure_unit"
|
|
9893
|
+
| "total_amount"
|
|
9894
|
+
| "total"
|
|
9895
|
+
| "code";
|
|
9896
|
+
visible: boolean;
|
|
9897
|
+
}[];
|
|
9898
|
+
ai_parsing_prompt_amendment?: string;
|
|
9899
|
+
ai_vision_prompt_amendment?: string;
|
|
9900
|
+
ai_parsing_prompt_overwrite?: string;
|
|
9901
|
+
ai_vision_prompt_overwrite?: string;
|
|
9902
|
+
enable_ai_parsing_prompt_amendment?: boolean;
|
|
9903
|
+
enable_ai_vision_prompt_amendment?: boolean;
|
|
9904
|
+
enable_ai_parsing_prompt_overwrite?: boolean;
|
|
9905
|
+
enable_ai_vision_prompt_overwrite?: boolean;
|
|
9906
|
+
always_merge_pages_for_job?: boolean;
|
|
9907
|
+
trim_zero_from_first?: boolean;
|
|
9908
|
+
}
|
|
9909
|
+
namespace Find {
|
|
9910
|
+
type Params = DefaultPaginationQueryParams & {
|
|
9911
|
+
_id?: StringId[] | StringId;
|
|
9912
|
+
client?: string[] | string;
|
|
9913
|
+
disabled?: boolean;
|
|
9914
|
+
doc_type?: string[] | string;
|
|
9915
|
+
};
|
|
9916
|
+
interface Result extends DefaultPaginationResult {
|
|
9917
|
+
data: Data[] | PopulatedDoc[];
|
|
9918
|
+
}
|
|
9919
|
+
}
|
|
9920
|
+
namespace Get {
|
|
9921
|
+
type ID = string;
|
|
9922
|
+
type Result = Data | PopulatedDoc;
|
|
9923
|
+
}
|
|
9924
|
+
namespace Create {
|
|
9925
|
+
type Body = CreateBody;
|
|
9926
|
+
type Result = Data;
|
|
9927
|
+
}
|
|
9928
|
+
namespace Update {
|
|
9929
|
+
type ID = string;
|
|
9930
|
+
type Body = UpdateBody;
|
|
9931
|
+
type Result = Data;
|
|
9932
|
+
}
|
|
9933
|
+
}
|
|
9934
|
+
namespace OcrInvoiceJobGroup {
|
|
9935
|
+
interface Data {
|
|
9936
|
+
_id: StringId;
|
|
9937
|
+
name: string;
|
|
9938
|
+
sync_id: string;
|
|
9939
|
+
company_namespace: string[];
|
|
9940
|
+
disabled: boolean;
|
|
9941
|
+
template: StringId;
|
|
9942
|
+
client: StringId | Pick<Client.ClientSchema, "name">;
|
|
9943
|
+
doc_type: "pdf" | "image";
|
|
9944
|
+
media: string[];
|
|
9945
|
+
creator: AdminOrRep;
|
|
9946
|
+
status:
|
|
9947
|
+
| "initiated"
|
|
9948
|
+
| "failed"
|
|
9949
|
+
| "incomplete"
|
|
9950
|
+
| "partially_completed"
|
|
9951
|
+
| "completed"
|
|
9952
|
+
| "in_progress";
|
|
9953
|
+
time: number;
|
|
9954
|
+
visit_id?: StringId;
|
|
9955
|
+
geo_tag: GeoTag;
|
|
9956
|
+
}
|
|
9957
|
+
interface PopulatedDoc {
|
|
9958
|
+
_id: StringId;
|
|
9959
|
+
name: string;
|
|
9960
|
+
sync_id: string;
|
|
9961
|
+
company_namespace: string[];
|
|
9962
|
+
disabled: boolean;
|
|
9963
|
+
template: StringId;
|
|
9964
|
+
template_poplated: OcrInvoiceJobTemplate.Data;
|
|
9965
|
+
client: StringId;
|
|
9966
|
+
client_populated: Pick<Client.ClientSchema, "name" | "_id">;
|
|
9967
|
+
doc_type: "pdf" | "image";
|
|
9968
|
+
media: StringId[];
|
|
9969
|
+
media_populated: PopulatedMediaStorage[];
|
|
9970
|
+
creator: AdminOrRep;
|
|
9971
|
+
status:
|
|
9972
|
+
| "initiated"
|
|
9973
|
+
| "failed"
|
|
9974
|
+
| "incomplete"
|
|
9975
|
+
| "partially_completed"
|
|
9976
|
+
| "completed"
|
|
9977
|
+
| "in_progress";
|
|
9978
|
+
time: number;
|
|
9979
|
+
visit_id?: StringId;
|
|
9980
|
+
geo_tag: GeoTag;
|
|
9981
|
+
}
|
|
9982
|
+
interface CreateBody {
|
|
9983
|
+
sync_id: string;
|
|
9984
|
+
name: string;
|
|
9985
|
+
company_namespace: string[];
|
|
9986
|
+
template: StringId;
|
|
9987
|
+
client: StringId;
|
|
9988
|
+
media: StringId[];
|
|
9989
|
+
creator?: AdminOrRep;
|
|
9990
|
+
time: number;
|
|
9991
|
+
visit_id?: StringId;
|
|
9992
|
+
geo_tag?: GeoTag;
|
|
9993
|
+
}
|
|
9994
|
+
namespace Find {
|
|
9995
|
+
type Params = DefaultPaginationQueryParams & {
|
|
9996
|
+
_id?: StringId[] | StringId;
|
|
9997
|
+
client?: string[] | string;
|
|
9998
|
+
disabled?: boolean;
|
|
9999
|
+
doc_type?: string[] | string;
|
|
10000
|
+
template?: StringId[] | StringId;
|
|
10001
|
+
visit_id?: StringId[] | StringId;
|
|
10002
|
+
from_time?: number;
|
|
10003
|
+
to_time?: number;
|
|
10004
|
+
status: string[];
|
|
10005
|
+
rep?: StringId[] | StringId;
|
|
10006
|
+
admin?: StringId[] | StringId;
|
|
10007
|
+
"creator._id"?: StringId[] | StringId;
|
|
10008
|
+
"creator.type"?: string[] | string;
|
|
10009
|
+
search?: string;
|
|
10010
|
+
};
|
|
10011
|
+
interface Result extends DefaultPaginationResult {
|
|
10012
|
+
data: Data[] | PopulatedDoc[];
|
|
10013
|
+
}
|
|
10014
|
+
}
|
|
10015
|
+
namespace Get {
|
|
10016
|
+
type ID = string;
|
|
10017
|
+
type Result = Data | PopulatedDoc;
|
|
10018
|
+
}
|
|
10019
|
+
namespace Create {
|
|
10020
|
+
type Body = CreateBody;
|
|
10021
|
+
type Result = Data;
|
|
10022
|
+
}
|
|
10023
|
+
}
|
|
10024
|
+
namespace OcrInvoiceJob {
|
|
10025
|
+
export type StepCode = "ai-api-js" | "python-utilities" | "job-handler";
|
|
10026
|
+
export type TaskCode =
|
|
10027
|
+
| "create-job-pages"
|
|
10028
|
+
| "photo-json-extraction"
|
|
10029
|
+
| "photo-text-extraction"
|
|
10030
|
+
| "pdf-text-extraction"
|
|
10031
|
+
| "text-json-parsing"
|
|
10032
|
+
| "pdf-image-conversion"
|
|
10033
|
+
| "pdf-image-text-ocr"
|
|
10034
|
+
| "finalize";
|
|
10035
|
+
export interface Task {
|
|
10036
|
+
code: TaskCode;
|
|
10037
|
+
options: {};
|
|
10038
|
+
}
|
|
10039
|
+
export type Step = {
|
|
10040
|
+
code: StepCode;
|
|
10041
|
+
tasks: Task[];
|
|
10042
|
+
};
|
|
10043
|
+
export interface PhotoTextExtractionTask extends Task {
|
|
10044
|
+
code: "photo-text-extraction";
|
|
10045
|
+
options: {};
|
|
10046
|
+
}
|
|
10047
|
+
export interface PhotoJsonExtractionTask extends Task {
|
|
10048
|
+
code: "photo-json-extraction";
|
|
10049
|
+
options: {
|
|
10050
|
+
ai_model: "gpt-4o-mini" | "gpt-4o";
|
|
10051
|
+
};
|
|
10052
|
+
}
|
|
10053
|
+
export interface PdfTextExtractionTask extends Task {
|
|
10054
|
+
code: "pdf-text-extraction";
|
|
10055
|
+
options: {};
|
|
10056
|
+
}
|
|
10057
|
+
export interface PdfImageConversionTask extends Task {
|
|
10058
|
+
code: "pdf-image-conversion";
|
|
10059
|
+
options: {};
|
|
10060
|
+
}
|
|
10061
|
+
export interface PdfImageTextOcrTask extends Task {
|
|
10062
|
+
code: "pdf-image-text-ocr";
|
|
10063
|
+
options: {};
|
|
10064
|
+
}
|
|
10065
|
+
export interface TextJsonParsingTask extends Task {
|
|
10066
|
+
code: "text-json-parsing";
|
|
10067
|
+
options: {
|
|
10068
|
+
ai_model: "gpt-4o-mini" | "gpt-4o";
|
|
10069
|
+
};
|
|
10070
|
+
}
|
|
10071
|
+
export interface FinalizeTask extends Task {
|
|
10072
|
+
code: "finalize";
|
|
10073
|
+
options: {};
|
|
10074
|
+
}
|
|
10075
|
+
export interface CreateJobPagesTask extends Task {
|
|
10076
|
+
code: "create-job-pages";
|
|
10077
|
+
options: {};
|
|
10078
|
+
}
|
|
10079
|
+
export type AiApiJsStep = {
|
|
10080
|
+
code: "ai-api-js";
|
|
10081
|
+
tasks: (
|
|
10082
|
+
| PhotoTextExtractionTask
|
|
10083
|
+
| PhotoJsonExtractionTask
|
|
10084
|
+
| TextJsonParsingTask
|
|
10085
|
+
)[];
|
|
10086
|
+
};
|
|
10087
|
+
export type PythonUtilitiesStep = {
|
|
10088
|
+
code: "python-utilities";
|
|
10089
|
+
tasks: (
|
|
10090
|
+
| PdfTextExtractionTask
|
|
10091
|
+
| PdfImageConversionTask
|
|
10092
|
+
| PdfImageTextOcrTask
|
|
10093
|
+
)[];
|
|
10094
|
+
};
|
|
10095
|
+
export type JobHandlerStep = {
|
|
10096
|
+
code: "job-handler";
|
|
10097
|
+
tasks: (FinalizeTask | CreateJobPagesTask | TextJsonParsingTask)[];
|
|
10098
|
+
};
|
|
10099
|
+
export type PlanStep = AiApiJsStep | JobHandlerStep | PythonUtilitiesStep;
|
|
10100
|
+
type PlanOptions = {
|
|
10101
|
+
early_page_generation?: boolean;
|
|
10102
|
+
};
|
|
10103
|
+
export type Plan = {
|
|
10104
|
+
steps: PlanStep[];
|
|
10105
|
+
options: PlanOptions;
|
|
10106
|
+
};
|
|
10107
|
+
export interface Data {
|
|
10108
|
+
_id: StringId;
|
|
10109
|
+
company_namespace: string[];
|
|
10110
|
+
disabled: boolean;
|
|
10111
|
+
template: StringId;
|
|
10112
|
+
client: StringId;
|
|
10113
|
+
doc_type: "pdf" | "image";
|
|
10114
|
+
convert_to_image?: boolean;
|
|
10115
|
+
rotate?: boolean;
|
|
10116
|
+
file_media: StringId;
|
|
10117
|
+
text_media?: StringId;
|
|
10118
|
+
pages_count?: number;
|
|
10119
|
+
createdAt: Date;
|
|
10120
|
+
updatedAt: Date;
|
|
10121
|
+
job_group: StringId;
|
|
10122
|
+
planner?: Plan;
|
|
10123
|
+
status:
|
|
10124
|
+
| "pending"
|
|
10125
|
+
| "initiated"
|
|
10126
|
+
| "incomplete"
|
|
10127
|
+
| "in_progress"
|
|
10128
|
+
| "completed"
|
|
10129
|
+
| "failed";
|
|
10130
|
+
creator: AdminOrRep;
|
|
10131
|
+
error_message?: any;
|
|
10132
|
+
}
|
|
10133
|
+
export interface PopulatedDoc {
|
|
10134
|
+
_id: StringId;
|
|
10135
|
+
company_namespace: string[];
|
|
10136
|
+
disabled: boolean;
|
|
10137
|
+
template: StringId;
|
|
10138
|
+
template_populated: Pick<OcrInvoiceJobTemplate.Data, "name" | "_id">;
|
|
10139
|
+
client: StringId;
|
|
10140
|
+
client_populated: Pick<Client.ClientSchema, "name" | "_id">;
|
|
10141
|
+
doc_type: "pdf" | "image";
|
|
10142
|
+
convert_to_image?: boolean;
|
|
10143
|
+
rotate?: boolean;
|
|
10144
|
+
file_media: StringId | PopulatedMediaStorage;
|
|
10145
|
+
file_media_populated: PopulatedMediaStorage;
|
|
10146
|
+
text_media?: StringId;
|
|
10147
|
+
pages_count?: number;
|
|
10148
|
+
createdAt: Date;
|
|
10149
|
+
updatedAt: Date;
|
|
10150
|
+
job_group: StringId;
|
|
10151
|
+
job_group_populated: Pick<OcrInvoiceJobGroup.Data, "name" | "_id">;
|
|
10152
|
+
planner?: Plan;
|
|
10153
|
+
status:
|
|
10154
|
+
| "pending"
|
|
10155
|
+
| "initiated"
|
|
10156
|
+
| "incomplete"
|
|
10157
|
+
| "in_progress"
|
|
10158
|
+
| "completed"
|
|
10159
|
+
| "failed";
|
|
10160
|
+
creator: AdminOrRep;
|
|
10161
|
+
error_message?: any;
|
|
10162
|
+
}
|
|
10163
|
+
export namespace Find {
|
|
10164
|
+
type Params = DefaultPaginationQueryParams & {
|
|
10165
|
+
_id?: StringId[] | StringId;
|
|
10166
|
+
disabled?: boolean;
|
|
10167
|
+
template: StringId[] | StringId;
|
|
10168
|
+
client?: StringId[] | StringId;
|
|
10169
|
+
doc_type?: string[] | string;
|
|
10170
|
+
job_group?: StringId[] | StringId;
|
|
10171
|
+
};
|
|
10172
|
+
interface Result extends DefaultPaginationResult {
|
|
10173
|
+
data: Data[] | PopulatedDoc[];
|
|
10174
|
+
}
|
|
10175
|
+
}
|
|
10176
|
+
export namespace Get {
|
|
10177
|
+
type ID = string;
|
|
10178
|
+
type Result = Data | PopulatedDoc;
|
|
10179
|
+
}
|
|
10180
|
+
export {};
|
|
10181
|
+
}
|
|
10182
|
+
namespace OcrInvoiceJobPage {
|
|
10183
|
+
interface AIInvoiceJsonSchema {
|
|
10184
|
+
new_page?: boolean;
|
|
10185
|
+
issue_date?: string;
|
|
10186
|
+
reference?: string;
|
|
10187
|
+
client_name?: string;
|
|
10188
|
+
items: [
|
|
10189
|
+
{
|
|
10190
|
+
barcode?: string;
|
|
10191
|
+
code?: string;
|
|
10192
|
+
description?: string;
|
|
10193
|
+
quantity?: number;
|
|
10194
|
+
unit_price?: number;
|
|
10195
|
+
total?: number;
|
|
10196
|
+
measure_unit?: string;
|
|
10197
|
+
total_amount?: number;
|
|
10198
|
+
tax_amount?: number;
|
|
10199
|
+
discount_amount?: number;
|
|
10200
|
+
}
|
|
10201
|
+
];
|
|
10202
|
+
total_amount?: number;
|
|
10203
|
+
total_tax?: number;
|
|
10204
|
+
}
|
|
10205
|
+
interface CartAnnotationErrorType {
|
|
10206
|
+
message: string;
|
|
10207
|
+
key:
|
|
10208
|
+
| "items.variant.listed_price"
|
|
10209
|
+
| "items.overwrite_price"
|
|
10210
|
+
| "items.tax"
|
|
10211
|
+
| "items.measure_unit"
|
|
10212
|
+
| "items.qty"
|
|
10213
|
+
| "items.variant.variant_sku"
|
|
10214
|
+
| "items.variant.variant_barcode"
|
|
10215
|
+
| "items.variant.product_barcode"
|
|
10216
|
+
| "items.variant.product_sku"
|
|
10217
|
+
| "items.cart_line_total"
|
|
10218
|
+
| "items.cart_line_amount"
|
|
10219
|
+
| "items.variant.product_id"
|
|
10220
|
+
| "items.variant.variant_id"
|
|
10221
|
+
| "total"
|
|
10222
|
+
| "tax_total"
|
|
10223
|
+
| "issue_date"
|
|
10224
|
+
| "external_serial_number"
|
|
10225
|
+
| "client";
|
|
10226
|
+
code:
|
|
10227
|
+
| "missing"
|
|
10228
|
+
| "not_equal"
|
|
10229
|
+
| "exists"
|
|
10230
|
+
| "invalid_date"
|
|
10231
|
+
| "custom_warning";
|
|
10232
|
+
}
|
|
10233
|
+
interface CartAnnotationItem {
|
|
10234
|
+
ai_json_data?: {
|
|
10235
|
+
barcode?: string;
|
|
10236
|
+
description?: string;
|
|
10237
|
+
qty?: number;
|
|
10238
|
+
measure_unit?: string;
|
|
10239
|
+
code?: string;
|
|
10240
|
+
unit_price?: number;
|
|
10241
|
+
total?: number;
|
|
10242
|
+
total_amount?: number;
|
|
10243
|
+
tax_amount?: number;
|
|
10244
|
+
discount_amount?: number;
|
|
10245
|
+
};
|
|
10246
|
+
overwrite_price?: number;
|
|
10247
|
+
client_id: StringId;
|
|
10248
|
+
qty: number;
|
|
10249
|
+
variant?: {
|
|
10250
|
+
product_id?: string;
|
|
10251
|
+
product_name?: string;
|
|
10252
|
+
product_sku?: string;
|
|
10253
|
+
product_barcode?: string;
|
|
10254
|
+
variant_id?: string;
|
|
10255
|
+
variant_name?: string;
|
|
10256
|
+
variant_sku?: string;
|
|
10257
|
+
variant_barcode?: string;
|
|
10258
|
+
listed_price?: number;
|
|
10259
|
+
};
|
|
10260
|
+
measure_unit?: {
|
|
10261
|
+
parent: string;
|
|
10262
|
+
name: string;
|
|
10263
|
+
factor: number;
|
|
10264
|
+
disabled: boolean;
|
|
10265
|
+
company_namespace: string[];
|
|
10266
|
+
};
|
|
10267
|
+
tax?: {
|
|
10268
|
+
name: string;
|
|
10269
|
+
rate: number;
|
|
10270
|
+
type: "inclusive" | "additive" | "N/A";
|
|
10271
|
+
ubl_tax_details?: {
|
|
10272
|
+
tax_code: {
|
|
10273
|
+
type: String;
|
|
10274
|
+
enum: ["Z", "O", "S", "E"];
|
|
10275
|
+
};
|
|
10276
|
+
reason: {
|
|
10277
|
+
type: String;
|
|
10278
|
+
};
|
|
10279
|
+
reason_code: {
|
|
10280
|
+
type: String;
|
|
10281
|
+
};
|
|
10282
|
+
};
|
|
10283
|
+
disabled: boolean;
|
|
10284
|
+
};
|
|
10285
|
+
warnings?: CartAnnotationErrorType[];
|
|
10286
|
+
_errors?: CartAnnotationErrorType[];
|
|
10287
|
+
status?: "red" | "green" | "orange";
|
|
10288
|
+
cart_line_total?: number;
|
|
10289
|
+
cart_line_amount?: number;
|
|
10290
|
+
ignore?: boolean;
|
|
10291
|
+
}
|
|
10292
|
+
interface CartAnnotation {
|
|
10293
|
+
issue_date: string;
|
|
10294
|
+
external_serial_number?: string;
|
|
10295
|
+
total: number;
|
|
10296
|
+
tax_total: number;
|
|
10297
|
+
cart_total: number;
|
|
10298
|
+
cart_tax_total: number;
|
|
10299
|
+
cart_total_before_tax: number;
|
|
10300
|
+
items: CartAnnotationItem[];
|
|
10301
|
+
warnings?: CartAnnotationErrorType[];
|
|
10302
|
+
_errors?: CartAnnotationErrorType[];
|
|
10303
|
+
status?: "red" | "orange" | "green";
|
|
10304
|
+
}
|
|
10305
|
+
interface Data {
|
|
10306
|
+
_id: string;
|
|
10307
|
+
company_namespace: string[];
|
|
10308
|
+
disabled: boolean;
|
|
10309
|
+
job: StringId;
|
|
10310
|
+
template: StringId;
|
|
10311
|
+
page_number: number;
|
|
10312
|
+
text?: string;
|
|
10313
|
+
media_url?: string;
|
|
10314
|
+
proforma?: StringId;
|
|
10315
|
+
cart?: Cart.Data;
|
|
10316
|
+
cart_annotation?: CartAnnotation;
|
|
10317
|
+
ai_invoice_json?: AIInvoiceJsonSchema;
|
|
10318
|
+
error_message?: any;
|
|
10319
|
+
client: StringId;
|
|
10320
|
+
status?:
|
|
10321
|
+
| "pending"
|
|
10322
|
+
| "in_progress"
|
|
10323
|
+
| "converted"
|
|
10324
|
+
| "failed"
|
|
10325
|
+
| "ready_to_convert"
|
|
10326
|
+
| "incomplete"
|
|
10327
|
+
| "merged";
|
|
10328
|
+
last_page: boolean;
|
|
10329
|
+
creator: AdminOrRep;
|
|
10330
|
+
editor?: AdminOrRep;
|
|
10331
|
+
createdAt: Date;
|
|
10332
|
+
updatedAt: Date;
|
|
10333
|
+
page_usage?: {
|
|
10334
|
+
input_tokens: number;
|
|
10335
|
+
output_tokens: number;
|
|
10336
|
+
weighted_input_tokens: number;
|
|
10337
|
+
weighted_output_tokens: number;
|
|
10338
|
+
total_weighted_tokens: number;
|
|
10339
|
+
ai_model?: "gpt-4o" | "gpt-4o-mini";
|
|
10340
|
+
};
|
|
10341
|
+
}
|
|
10342
|
+
interface PopulatedDoc {
|
|
10343
|
+
_id: StringId;
|
|
10344
|
+
company_namespace: string[];
|
|
10345
|
+
disabled: boolean;
|
|
10346
|
+
job: StringId;
|
|
10347
|
+
job_populated: OcrInvoiceJob.Data & {
|
|
10348
|
+
job_group_populated: OcrInvoiceJobGroup.Data;
|
|
10349
|
+
};
|
|
10350
|
+
template: StringId;
|
|
10351
|
+
template_populated: Pick<OcrInvoiceJobTemplate.Data, "name" | "_id">;
|
|
10352
|
+
page_number: number;
|
|
10353
|
+
text?: string;
|
|
10354
|
+
media_url?: string;
|
|
10355
|
+
proforma?: StringId;
|
|
10356
|
+
proforma_populated?: Pick<
|
|
10357
|
+
Proforma.ProformaSchema,
|
|
10358
|
+
"serial_number" | "_id"
|
|
10359
|
+
>;
|
|
10360
|
+
cart?: Cart.Data;
|
|
10361
|
+
cart_annotation?: CartAnnotation;
|
|
10362
|
+
ai_invoice_json?: AIInvoiceJsonSchema;
|
|
10363
|
+
error_message?: any;
|
|
10364
|
+
client: StringId;
|
|
10365
|
+
client_populated: Pick<Client.ClientSchema, "_id" | "name">;
|
|
10366
|
+
status?:
|
|
10367
|
+
| "pending"
|
|
10368
|
+
| "in_progress"
|
|
10369
|
+
| "converted"
|
|
10370
|
+
| "failed"
|
|
10371
|
+
| "ready_to_convert"
|
|
10372
|
+
| "incomplete"
|
|
10373
|
+
| "merged";
|
|
10374
|
+
last_page: boolean;
|
|
10375
|
+
creator: AdminOrRep;
|
|
10376
|
+
editor?: AdminOrRep;
|
|
10377
|
+
createdAt: Date;
|
|
10378
|
+
updatedAt: Date;
|
|
10379
|
+
page_usage?: {
|
|
10380
|
+
input_tokens: number;
|
|
10381
|
+
output_tokens: number;
|
|
10382
|
+
weighted_input_tokens: number;
|
|
10383
|
+
weighted_output_tokens: number;
|
|
10384
|
+
total_weighted_tokens: number;
|
|
10385
|
+
ai_model?: "gpt-4o" | "gpt-4o-mini";
|
|
10386
|
+
};
|
|
10387
|
+
}
|
|
10388
|
+
interface UpdateBody {
|
|
10389
|
+
disabled: boolean;
|
|
10390
|
+
cart_annotation?: CartAnnotation;
|
|
10391
|
+
client: StringId;
|
|
10392
|
+
cart?: Cart.Data;
|
|
10393
|
+
}
|
|
10394
|
+
namespace Find {
|
|
10395
|
+
type Params = DefaultPaginationQueryParams & {
|
|
10396
|
+
_id?: StringId | StringId[];
|
|
10397
|
+
job?: StringId | StringId[];
|
|
10398
|
+
template?: StringId | StringId[];
|
|
10399
|
+
page_number?: number;
|
|
10400
|
+
proforma?: StringId | StringId[];
|
|
10401
|
+
status: string | string[];
|
|
10402
|
+
};
|
|
10403
|
+
interface Result extends DefaultPaginationResult {
|
|
10404
|
+
data: Data[] | PopulatedDoc[];
|
|
10405
|
+
}
|
|
10406
|
+
}
|
|
10407
|
+
namespace Get {
|
|
10408
|
+
type ID = string;
|
|
10409
|
+
type Result = Data | PopulatedDoc;
|
|
10410
|
+
}
|
|
10411
|
+
namespace Update {
|
|
10412
|
+
type ID = StringId;
|
|
10413
|
+
type Body = UpdateBody;
|
|
10414
|
+
type Result = Data;
|
|
10415
|
+
}
|
|
10416
|
+
}
|
|
10417
|
+
namespace ActivityAiSalesOrder {
|
|
10418
|
+
interface Data {
|
|
10419
|
+
_id: string;
|
|
10420
|
+
creator: RepCreator;
|
|
10421
|
+
editor?: RepCreator;
|
|
10422
|
+
teams: StringId[];
|
|
10423
|
+
tags: StringId[];
|
|
10424
|
+
time: number;
|
|
10425
|
+
client?: StringId;
|
|
10426
|
+
client_name?: string;
|
|
10427
|
+
visit?: StringId;
|
|
10428
|
+
visit_id?: string;
|
|
10429
|
+
route?: string;
|
|
10430
|
+
sync_id: string;
|
|
10431
|
+
template_id: StringId;
|
|
10432
|
+
jo_group_id?: StringId;
|
|
10433
|
+
media: StringId[];
|
|
10434
|
+
geo_tag?: GeoTag;
|
|
10435
|
+
geoPoint?: GeoPoint;
|
|
10436
|
+
platform?: string;
|
|
10437
|
+
version_name?: string;
|
|
10438
|
+
battery_level?: number;
|
|
10439
|
+
device_brand?: string;
|
|
10440
|
+
device_os?: string;
|
|
10441
|
+
device_os_version?: string;
|
|
10442
|
+
device_model?: string;
|
|
10443
|
+
identifier?: number;
|
|
10444
|
+
device_id?: string;
|
|
10445
|
+
device_unique_id?: string;
|
|
10446
|
+
network_state?: number;
|
|
10447
|
+
time_zone?: string;
|
|
10448
|
+
job_start_time?: number;
|
|
10449
|
+
job_end_time?: number;
|
|
10450
|
+
job_duration?: number;
|
|
10451
|
+
company_namespace: string[];
|
|
10452
|
+
createdAt: Date;
|
|
10453
|
+
updatedAt: Date;
|
|
10454
|
+
}
|
|
10455
|
+
interface PopulatedDoc {
|
|
10456
|
+
_id: string;
|
|
10457
|
+
creator: RepCreator;
|
|
10458
|
+
editor?: RepCreator;
|
|
10459
|
+
teams: StringId[];
|
|
10460
|
+
teams_populated: Pick<Team.TeamSchema, "name" | "_id">[];
|
|
10461
|
+
tags: StringId[];
|
|
10462
|
+
tags_populated: Pick<Tag.TagSchema, "tag" | "type" | "_id">[];
|
|
10463
|
+
time: number;
|
|
10464
|
+
client?: StringId;
|
|
10465
|
+
client_populated?: Pick<
|
|
10466
|
+
Client.ClientSchema,
|
|
10467
|
+
"name" | "client_code" | "_id"
|
|
10468
|
+
>;
|
|
10469
|
+
client_name?: string;
|
|
10470
|
+
visit?: string;
|
|
10471
|
+
visit_populated?: Visit.VisitSchema;
|
|
10472
|
+
visit_id?: string;
|
|
10473
|
+
route?: StringId;
|
|
10474
|
+
route_populated?: Pick<Route.RouteSchema, "name" | "_id">;
|
|
10475
|
+
sync_id: string;
|
|
10476
|
+
template_id: StringId;
|
|
10477
|
+
jo_group_id?: StringId;
|
|
10478
|
+
jo_group_id_populated?: Pick<
|
|
10479
|
+
OcrInvoiceJobGroup.Data,
|
|
10480
|
+
"name" | "status" | "_id"
|
|
10481
|
+
>;
|
|
10482
|
+
media: StringId[];
|
|
10483
|
+
media_populated: PopulatedMediaStorage[];
|
|
10484
|
+
geo_tag?: GeoTag;
|
|
10485
|
+
geoPoint?: GeoPoint;
|
|
10486
|
+
platform?: string;
|
|
10487
|
+
version_name?: string;
|
|
10488
|
+
battery_level?: number;
|
|
10489
|
+
device_brand?: string;
|
|
10490
|
+
device_os?: string;
|
|
10491
|
+
device_os_version?: string;
|
|
10492
|
+
device_model?: string;
|
|
10493
|
+
identifier?: number;
|
|
10494
|
+
device_id?: string;
|
|
10495
|
+
device_unique_id?: string;
|
|
10496
|
+
network_state?: number;
|
|
10497
|
+
time_zone?: string;
|
|
10498
|
+
job_start_time?: number;
|
|
10499
|
+
job_end_time?: number;
|
|
10500
|
+
job_duration?: number;
|
|
10501
|
+
company_namespace: string[];
|
|
10502
|
+
createdAt: Date;
|
|
10503
|
+
updatedAt: Date;
|
|
10504
|
+
}
|
|
10505
|
+
interface CreateBody {
|
|
10506
|
+
creator: RepCreator;
|
|
10507
|
+
teams: StringId[];
|
|
10508
|
+
tags: StringId[];
|
|
10509
|
+
time: number;
|
|
10510
|
+
client?: StringId;
|
|
10511
|
+
client_name?: string;
|
|
10512
|
+
visit?: StringId;
|
|
10513
|
+
visit_id?: string;
|
|
10514
|
+
route?: string;
|
|
10515
|
+
sync_id: string;
|
|
10516
|
+
template_id: StringId;
|
|
10517
|
+
media: StringId[];
|
|
10518
|
+
geo_tag?: GeoTag;
|
|
10519
|
+
geoPoint?: GeoPoint;
|
|
10520
|
+
platform?: string;
|
|
10521
|
+
version_name?: string;
|
|
10522
|
+
battery_level?: number;
|
|
10523
|
+
device_brand?: string;
|
|
10524
|
+
device_os?: string;
|
|
10525
|
+
device_os_version?: string;
|
|
10526
|
+
device_model?: string;
|
|
10527
|
+
identifier?: number;
|
|
10528
|
+
device_id?: string;
|
|
10529
|
+
device_unique_id?: string;
|
|
10530
|
+
network_state?: number;
|
|
10531
|
+
time_zone?: string;
|
|
10532
|
+
job_start_time?: number;
|
|
10533
|
+
job_end_time?: number;
|
|
10534
|
+
job_duration?: number;
|
|
10535
|
+
company_namespace: string[];
|
|
10536
|
+
}
|
|
10537
|
+
namespace Find {
|
|
10538
|
+
type Params = DefaultPaginationQueryParams & {
|
|
10539
|
+
_id?: StringId | StringId[];
|
|
10540
|
+
job?: StringId | StringId[];
|
|
10541
|
+
template?: StringId | StringId[];
|
|
10542
|
+
page_number?: number;
|
|
10543
|
+
proforma?: StringId | StringId[];
|
|
10544
|
+
status: string | string[];
|
|
10545
|
+
};
|
|
10546
|
+
interface Result extends DefaultPaginationResult {
|
|
10547
|
+
data: Data[] | PopulatedDoc[];
|
|
10548
|
+
}
|
|
10549
|
+
}
|
|
10550
|
+
namespace Get {
|
|
10551
|
+
type ID = string;
|
|
10552
|
+
type Result = Data | PopulatedDoc;
|
|
10553
|
+
}
|
|
10554
|
+
namespace Create {
|
|
10555
|
+
type Body = CreateBody;
|
|
10556
|
+
type Result = Data;
|
|
10557
|
+
}
|
|
10558
|
+
}
|
|
9233
10559
|
}
|
|
9234
|
-
export
|
|
9235
|
-
export
|
|
10560
|
+
export type StringId = string;
|
|
10561
|
+
export type NameSpaces = string[];
|
|
9236
10562
|
export interface AdminOrRep {
|
|
9237
10563
|
_id: StringId;
|
|
9238
10564
|
name?: string;
|
|
@@ -9240,7 +10566,7 @@ export interface AdminOrRep {
|
|
|
9240
10566
|
admin?: StringId;
|
|
9241
10567
|
rep?: StringId;
|
|
9242
10568
|
}
|
|
9243
|
-
|
|
10569
|
+
type PopulatedMediaStorage = Pick<
|
|
9244
10570
|
Service.MediaStorage.MediaStorageSchema,
|
|
9245
10571
|
| "_id"
|
|
9246
10572
|
| "createdAt"
|