repzo 1.0.86 → 1.0.88
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 +1335 -12
- package/package.json +1 -1
- package/src/index.ts +162 -0
- package/src/types/index.ts +1292 -0
package/src/types/index.ts
CHANGED
|
@@ -4667,6 +4667,7 @@ export namespace Service {
|
|
|
4667
4667
|
status: WorkorderStatus;
|
|
4668
4668
|
assets?: string[];
|
|
4669
4669
|
asset_units?: string[];
|
|
4670
|
+
asset_part_units?: StringId[];
|
|
4670
4671
|
workorder_categories: string[];
|
|
4671
4672
|
due_date?: number;
|
|
4672
4673
|
start_date?: number;
|
|
@@ -4706,6 +4707,24 @@ export namespace Service {
|
|
|
4706
4707
|
client_populated?: Pick<Client.ClientSchema, "client_code" | "name">;
|
|
4707
4708
|
asset_units_populated?: AssetUnitsPopulated[];
|
|
4708
4709
|
assets_populated?: AssetsPopulated[];
|
|
4710
|
+
asset_part_units_populated?: (Pick<
|
|
4711
|
+
AssetPartUnit.Data,
|
|
4712
|
+
| "_id"
|
|
4713
|
+
| "asset_part"
|
|
4714
|
+
| "custom_status"
|
|
4715
|
+
| "qty"
|
|
4716
|
+
| "directional_status"
|
|
4717
|
+
| "warehouse"
|
|
4718
|
+
| "warehouse_name"
|
|
4719
|
+
> & {
|
|
4720
|
+
asset_part: Pick<AssetPart.Data, "_id" | "name" | "local_name"> & {
|
|
4721
|
+
cover_photo?: PopulatedMediaStorage[];
|
|
4722
|
+
};
|
|
4723
|
+
custom_status?: Pick<
|
|
4724
|
+
CustomStatus.CustomStatusSchema,
|
|
4725
|
+
"_id" | "code" | "color" | "local_name" | "name"
|
|
4726
|
+
>;
|
|
4727
|
+
})[];
|
|
4709
4728
|
assigned_to_populated?: RepresentativesPopulated;
|
|
4710
4729
|
client_location_populated?: ClientLocationPopulated;
|
|
4711
4730
|
workorder_categories_populated?: WorkorderCategoryPopulated[];
|
|
@@ -4724,6 +4743,7 @@ export namespace Service {
|
|
|
4724
4743
|
status: WorkorderStatus;
|
|
4725
4744
|
assets?: string[];
|
|
4726
4745
|
asset_units?: string[];
|
|
4746
|
+
asset_part_units?: StringId[];
|
|
4727
4747
|
workorder_categories: string[];
|
|
4728
4748
|
due_date?: number;
|
|
4729
4749
|
start_date?: number;
|
|
@@ -4760,6 +4780,7 @@ export namespace Service {
|
|
|
4760
4780
|
status: WorkorderStatus;
|
|
4761
4781
|
assets?: string[];
|
|
4762
4782
|
asset_units?: string[];
|
|
4783
|
+
asset_part_units?: StringId[];
|
|
4763
4784
|
workorder_categories: string[];
|
|
4764
4785
|
due_date?: number;
|
|
4765
4786
|
start_date?: number;
|
|
@@ -4803,6 +4824,7 @@ export namespace Service {
|
|
|
4803
4824
|
type PopulatedKeys =
|
|
4804
4825
|
| "client"
|
|
4805
4826
|
| "asset_units"
|
|
4827
|
+
| "asset_part_units"
|
|
4806
4828
|
| "assets"
|
|
4807
4829
|
| "assigned_to"
|
|
4808
4830
|
| "client_location"
|
|
@@ -4824,6 +4846,7 @@ export namespace Service {
|
|
|
4824
4846
|
client?: string;
|
|
4825
4847
|
assets?: string[];
|
|
4826
4848
|
asset_units?: string[];
|
|
4849
|
+
asset_part_units?: StringId[];
|
|
4827
4850
|
due_date?: number;
|
|
4828
4851
|
start_date?: number;
|
|
4829
4852
|
forms?: string[];
|
|
@@ -8231,7 +8254,9 @@ export namespace Service {
|
|
|
8231
8254
|
client: StringId;
|
|
8232
8255
|
client_name: string;
|
|
8233
8256
|
warehouse: StringId;
|
|
8257
|
+
warehouse_name?: string;
|
|
8234
8258
|
receival_warehouse: string;
|
|
8259
|
+
receival_warehouse_name?: string;
|
|
8235
8260
|
asset_part: StringId;
|
|
8236
8261
|
asset_part_name: string;
|
|
8237
8262
|
qty: number;
|
|
@@ -9066,6 +9091,1273 @@ export namespace Service {
|
|
|
9066
9091
|
export type Result = { nFound: number; nModified: number };
|
|
9067
9092
|
}
|
|
9068
9093
|
}
|
|
9094
|
+
|
|
9095
|
+
export namespace Cart {
|
|
9096
|
+
export type Promo = Promotion.Schema & {
|
|
9097
|
+
details: Promotion.Schema["details"] & { promotions_enabled?: boolean };
|
|
9098
|
+
applied: {
|
|
9099
|
+
doesApply: boolean;
|
|
9100
|
+
appliedCount: number;
|
|
9101
|
+
limit_reached: boolean;
|
|
9102
|
+
is_prospective: boolean;
|
|
9103
|
+
rounds_status: ("full" | "partial" | "none")[];
|
|
9104
|
+
last_round_buy_success: boolean;
|
|
9105
|
+
used: boolean;
|
|
9106
|
+
bulk_get_limit_values: number[];
|
|
9107
|
+
};
|
|
9108
|
+
promoApplicableCount: number;
|
|
9109
|
+
};
|
|
9110
|
+
export interface Data {
|
|
9111
|
+
_id: StringId;
|
|
9112
|
+
type: "invoice" | "proforma";
|
|
9113
|
+
processable?: boolean;
|
|
9114
|
+
failure_reasons: string[];
|
|
9115
|
+
external_serial_number?: string;
|
|
9116
|
+
qr_code_tlv?: string;
|
|
9117
|
+
skip_promos?: boolean;
|
|
9118
|
+
skipped_promotions: { _id: string; name: string; ref: string }[];
|
|
9119
|
+
client_id: StringId;
|
|
9120
|
+
client_name: string;
|
|
9121
|
+
comment?: string;
|
|
9122
|
+
return_comment?: string;
|
|
9123
|
+
creator: {
|
|
9124
|
+
_id: string;
|
|
9125
|
+
type: "rep" | "client" | "admin";
|
|
9126
|
+
rep?: string;
|
|
9127
|
+
admin?: string;
|
|
9128
|
+
client?: string;
|
|
9129
|
+
name?: string;
|
|
9130
|
+
};
|
|
9131
|
+
implemented_by?: {
|
|
9132
|
+
_id: string;
|
|
9133
|
+
type: "rep" | "client" | "admin";
|
|
9134
|
+
rep?: string;
|
|
9135
|
+
admin?: string;
|
|
9136
|
+
client?: string;
|
|
9137
|
+
name?: string;
|
|
9138
|
+
};
|
|
9139
|
+
latest: boolean;
|
|
9140
|
+
version?: number;
|
|
9141
|
+
time?: number;
|
|
9142
|
+
issue_date: string;
|
|
9143
|
+
delivery_date?: string;
|
|
9144
|
+
currency: string;
|
|
9145
|
+
serial_number?: SerialNumber;
|
|
9146
|
+
geo_tag: { type: "Point"; coordinates: number[] };
|
|
9147
|
+
sync_id: string;
|
|
9148
|
+
address?: { [key: string]: any };
|
|
9149
|
+
company_namespace: string[];
|
|
9150
|
+
promotions: Promo[];
|
|
9151
|
+
priceLists: PriceListItem.PriceListItemSchema[];
|
|
9152
|
+
visit_id?: string;
|
|
9153
|
+
teams: string[];
|
|
9154
|
+
converter?: {
|
|
9155
|
+
_id: string;
|
|
9156
|
+
type: "rep" | "client" | "admin";
|
|
9157
|
+
rep?: string;
|
|
9158
|
+
admin?: string;
|
|
9159
|
+
client?: string;
|
|
9160
|
+
name?: string;
|
|
9161
|
+
};
|
|
9162
|
+
converted_proforma_serial_number?: SerialNumber;
|
|
9163
|
+
converted_proforma_return_serial_number?: SerialNumber;
|
|
9164
|
+
proforma_reference?: string;
|
|
9165
|
+
converted_at?: number;
|
|
9166
|
+
exclude_return_items?: boolean;
|
|
9167
|
+
returned_from?: string;
|
|
9168
|
+
returned_to?: string;
|
|
9169
|
+
returned_from_serial_number?: SerialNumber;
|
|
9170
|
+
returned_to_serial_number?: SerialNumber;
|
|
9171
|
+
due_date?: string;
|
|
9172
|
+
return_serial_number?: SerialNumber;
|
|
9173
|
+
origin_warehouse?: string;
|
|
9174
|
+
msl_sales?: string;
|
|
9175
|
+
route?: string;
|
|
9176
|
+
paymentsData: {
|
|
9177
|
+
invoice_value: number;
|
|
9178
|
+
paid: number;
|
|
9179
|
+
balance: number;
|
|
9180
|
+
payments: {
|
|
9181
|
+
payment_serial_number?: SerialNumber;
|
|
9182
|
+
payment_id?: string;
|
|
9183
|
+
invoice_serial_number?: SerialNumber;
|
|
9184
|
+
return_serial_number?: SerialNumber;
|
|
9185
|
+
fullinvoice_id?: string;
|
|
9186
|
+
view_serial_number?: SerialNumber;
|
|
9187
|
+
type: "invoice" | "payment" | "return_invoice";
|
|
9188
|
+
amount: number;
|
|
9189
|
+
}[];
|
|
9190
|
+
};
|
|
9191
|
+
consumption: {
|
|
9192
|
+
status: "consumed" | "unconsumed" | "partially_consumed";
|
|
9193
|
+
remainder: number;
|
|
9194
|
+
};
|
|
9195
|
+
subtotal?: number;
|
|
9196
|
+
discount_amount?: number;
|
|
9197
|
+
discount_amount_float?: number;
|
|
9198
|
+
taxable_subtotal?: number;
|
|
9199
|
+
net_total?: number;
|
|
9200
|
+
tax_amount?: number;
|
|
9201
|
+
tax_amount_after_deduction_float?: number;
|
|
9202
|
+
tax_amount_after_deduction_float_rounded_sum?: number;
|
|
9203
|
+
tax_amount_after_deduction_float_rounded?: number;
|
|
9204
|
+
total?: number;
|
|
9205
|
+
total_float?: number;
|
|
9206
|
+
total_float_rounded?: number;
|
|
9207
|
+
total_float_rounded_sum?: number;
|
|
9208
|
+
total_before_tax?: number;
|
|
9209
|
+
taxable_amount_float?: number;
|
|
9210
|
+
taxable_amount_float_rounded_sum?: number;
|
|
9211
|
+
taxable_amount_float_rounded?: number;
|
|
9212
|
+
pre_subtotal?: number;
|
|
9213
|
+
pre_discount_amount?: number;
|
|
9214
|
+
pre_discount_amount_float?: number;
|
|
9215
|
+
pre_taxable_subtotal?: number;
|
|
9216
|
+
pre_net_total?: number;
|
|
9217
|
+
pre_tax_amount?: number;
|
|
9218
|
+
pre_tax_amount_after_deduction_float?: number;
|
|
9219
|
+
pre_tax_amount_after_deduction_float_rounded?: number;
|
|
9220
|
+
pre_tax_amount_after_deduction_float_rounded_sum?: number;
|
|
9221
|
+
pre_total?: number;
|
|
9222
|
+
pre_total_float?: number;
|
|
9223
|
+
pre_total_float_rounded?: number;
|
|
9224
|
+
pre_total_float_rounded_sum?: number;
|
|
9225
|
+
pre_total_before_tax?: number;
|
|
9226
|
+
pre_taxable_amount_float?: number;
|
|
9227
|
+
pre_taxable_amount_float_rounded?: number;
|
|
9228
|
+
pre_taxable_amount_float_rounded_sum?: number;
|
|
9229
|
+
return_subtotal?: number;
|
|
9230
|
+
return_discount_amount?: number;
|
|
9231
|
+
return_discount_amount_float?: number;
|
|
9232
|
+
return_taxable_subtotal?: number;
|
|
9233
|
+
return_net_total?: number;
|
|
9234
|
+
return_tax_amount?: number;
|
|
9235
|
+
return_tax_amount_after_deduction_float?: number;
|
|
9236
|
+
return_tax_amount_after_deduction_float_rounded?: number;
|
|
9237
|
+
return_tax_amount_after_deduction_float_rounded_sum?: number;
|
|
9238
|
+
return_total?: number;
|
|
9239
|
+
return_total_float?: number;
|
|
9240
|
+
return_total_float_rounded?: number;
|
|
9241
|
+
return_total_float_rounded_sum?: number;
|
|
9242
|
+
return_total_before_tax?: number;
|
|
9243
|
+
return_taxable_amount_float?: number;
|
|
9244
|
+
return_taxable_amount_float_rounded?: number;
|
|
9245
|
+
return_taxable_amount_float_rounded_sum?: number;
|
|
9246
|
+
deductionRatio?: number;
|
|
9247
|
+
deductionFixed?: number;
|
|
9248
|
+
totalDeductedTax?: number;
|
|
9249
|
+
totalDeductedTaxFloat?: number;
|
|
9250
|
+
totalDeduction?: number;
|
|
9251
|
+
totalDeductionFloat?: number;
|
|
9252
|
+
totalDeductionBeforeTax?: number;
|
|
9253
|
+
totalDeductionBeforeTaxFloat?: number;
|
|
9254
|
+
totalAfterDeduction?: number;
|
|
9255
|
+
totalAfterDeductionFloat?: number;
|
|
9256
|
+
lines_discount?: number;
|
|
9257
|
+
lines_discount_float?: number;
|
|
9258
|
+
taxes: { [key: string]: any };
|
|
9259
|
+
overwriteDeductionFixed?: number;
|
|
9260
|
+
overwriteTaxExempt?: boolean;
|
|
9261
|
+
tax_exempt?: boolean;
|
|
9262
|
+
overwriteDeductionRatio?: number;
|
|
9263
|
+
shipping_zone?: { [key: string]: any };
|
|
9264
|
+
payment_method?: { [key: string]: any };
|
|
9265
|
+
shipping_price?: number;
|
|
9266
|
+
shipping_tax?: number;
|
|
9267
|
+
shipping_charge?: number;
|
|
9268
|
+
payment_charge?: number;
|
|
9269
|
+
total_with_charges?: number;
|
|
9270
|
+
payment?: { amount?: number };
|
|
9271
|
+
workorder?: string;
|
|
9272
|
+
asset?: string;
|
|
9273
|
+
asset_unit?: string;
|
|
9274
|
+
signature?: string;
|
|
9275
|
+
createdAt: Date;
|
|
9276
|
+
updatedAt: Date;
|
|
9277
|
+
items: (Item.Schema & { notes?: { [key: string]: any } })[];
|
|
9278
|
+
return_items?: (Item.Schema & { notes?: { [key: string]: any } })[];
|
|
9279
|
+
invoice_payment_type: "cash" | "credit";
|
|
9280
|
+
total_items_base_unit_qty?: number;
|
|
9281
|
+
total_items_qty?: number;
|
|
9282
|
+
total_return_items_base_unit_qty?: number;
|
|
9283
|
+
total_return_items_qty?: number;
|
|
9284
|
+
cart?: { [key: string]: any };
|
|
9285
|
+
__v?: number;
|
|
9286
|
+
}
|
|
9287
|
+
|
|
9288
|
+
export interface CreateBody {
|
|
9289
|
+
type: "invoice" | "proforma";
|
|
9290
|
+
processable?: boolean;
|
|
9291
|
+
failure_reasons: string[];
|
|
9292
|
+
external_serial_number?: string;
|
|
9293
|
+
skip_promos?: boolean;
|
|
9294
|
+
skipped_promotions: { _id: string; name: string; ref: string }[];
|
|
9295
|
+
client_id: StringId;
|
|
9296
|
+
client_name: string;
|
|
9297
|
+
comment?: string;
|
|
9298
|
+
return_comment?: string;
|
|
9299
|
+
creator: {
|
|
9300
|
+
_id: string;
|
|
9301
|
+
type: "rep" | "client" | "admin";
|
|
9302
|
+
rep?: string;
|
|
9303
|
+
admin?: string;
|
|
9304
|
+
client?: string;
|
|
9305
|
+
name?: string;
|
|
9306
|
+
};
|
|
9307
|
+
implemented_by?: {
|
|
9308
|
+
_id: string;
|
|
9309
|
+
type: "rep" | "client" | "admin";
|
|
9310
|
+
rep?: string;
|
|
9311
|
+
admin?: string;
|
|
9312
|
+
client?: string;
|
|
9313
|
+
name?: string;
|
|
9314
|
+
};
|
|
9315
|
+
latest: boolean;
|
|
9316
|
+
version?: number;
|
|
9317
|
+
time?: number;
|
|
9318
|
+
issue_date: string;
|
|
9319
|
+
delivery_date?: string;
|
|
9320
|
+
currency: string;
|
|
9321
|
+
serial_number?: SerialNumber;
|
|
9322
|
+
geo_tag: { type: "Point"; coordinates: number[] };
|
|
9323
|
+
sync_id: string;
|
|
9324
|
+
address?: { [key: string]: any };
|
|
9325
|
+
company_namespace: string[];
|
|
9326
|
+
promotions: Promo[];
|
|
9327
|
+
priceLists: PriceListItem.PriceListItemSchema[];
|
|
9328
|
+
visit_id?: string;
|
|
9329
|
+
teams: string[];
|
|
9330
|
+
converter?: {
|
|
9331
|
+
_id: string;
|
|
9332
|
+
type: "rep" | "client" | "admin";
|
|
9333
|
+
rep?: string;
|
|
9334
|
+
admin?: string;
|
|
9335
|
+
client?: string;
|
|
9336
|
+
name?: string;
|
|
9337
|
+
};
|
|
9338
|
+
converted_proforma_serial_number?: SerialNumber;
|
|
9339
|
+
converted_proforma_return_serial_number?: SerialNumber;
|
|
9340
|
+
proforma_reference?: string;
|
|
9341
|
+
converted_at?: number;
|
|
9342
|
+
exclude_return_items?: boolean;
|
|
9343
|
+
returned_from?: string;
|
|
9344
|
+
returned_to?: string;
|
|
9345
|
+
returned_from_serial_number?: SerialNumber;
|
|
9346
|
+
returned_to_serial_number?: SerialNumber;
|
|
9347
|
+
due_date?: string;
|
|
9348
|
+
return_serial_number?: SerialNumber;
|
|
9349
|
+
origin_warehouse?: string;
|
|
9350
|
+
msl_sales?: string;
|
|
9351
|
+
route?: string;
|
|
9352
|
+
paymentsData: {
|
|
9353
|
+
invoice_value: number;
|
|
9354
|
+
paid: number;
|
|
9355
|
+
balance: number;
|
|
9356
|
+
payments: {
|
|
9357
|
+
payment_serial_number?: SerialNumber;
|
|
9358
|
+
payment_id?: string;
|
|
9359
|
+
invoice_serial_number?: SerialNumber;
|
|
9360
|
+
return_serial_number?: SerialNumber;
|
|
9361
|
+
fullinvoice_id?: string;
|
|
9362
|
+
view_serial_number?: SerialNumber;
|
|
9363
|
+
type: "invoice" | "payment" | "return_invoice";
|
|
9364
|
+
amount: number;
|
|
9365
|
+
}[];
|
|
9366
|
+
};
|
|
9367
|
+
consumption: {
|
|
9368
|
+
status: "consumed" | "unconsumed" | "partially_consumed";
|
|
9369
|
+
remainder: number;
|
|
9370
|
+
};
|
|
9371
|
+
subtotal?: number;
|
|
9372
|
+
discount_amount?: number;
|
|
9373
|
+
discount_amount_float?: number;
|
|
9374
|
+
taxable_subtotal?: number;
|
|
9375
|
+
net_total?: number;
|
|
9376
|
+
tax_amount?: number;
|
|
9377
|
+
tax_amount_after_deduction_float?: number;
|
|
9378
|
+
tax_amount_after_deduction_float_rounded_sum?: number;
|
|
9379
|
+
tax_amount_after_deduction_float_rounded?: number;
|
|
9380
|
+
total?: number;
|
|
9381
|
+
total_float?: number;
|
|
9382
|
+
total_float_rounded?: number;
|
|
9383
|
+
total_float_rounded_sum?: number;
|
|
9384
|
+
total_before_tax?: number;
|
|
9385
|
+
taxable_amount_float?: number;
|
|
9386
|
+
taxable_amount_float_rounded_sum?: number;
|
|
9387
|
+
taxable_amount_float_rounded?: number;
|
|
9388
|
+
pre_subtotal?: number;
|
|
9389
|
+
pre_discount_amount?: number;
|
|
9390
|
+
pre_discount_amount_float?: number;
|
|
9391
|
+
pre_taxable_subtotal?: number;
|
|
9392
|
+
pre_net_total?: number;
|
|
9393
|
+
pre_tax_amount?: number;
|
|
9394
|
+
pre_tax_amount_after_deduction_float?: number;
|
|
9395
|
+
pre_tax_amount_after_deduction_float_rounded?: number;
|
|
9396
|
+
pre_tax_amount_after_deduction_float_rounded_sum?: number;
|
|
9397
|
+
pre_total?: number;
|
|
9398
|
+
pre_total_float?: number;
|
|
9399
|
+
pre_total_float_rounded?: number;
|
|
9400
|
+
pre_total_float_rounded_sum?: number;
|
|
9401
|
+
pre_total_before_tax?: number;
|
|
9402
|
+
pre_taxable_amount_float?: number;
|
|
9403
|
+
pre_taxable_amount_float_rounded?: number;
|
|
9404
|
+
pre_taxable_amount_float_rounded_sum?: number;
|
|
9405
|
+
return_subtotal?: number;
|
|
9406
|
+
return_discount_amount?: number;
|
|
9407
|
+
return_discount_amount_float?: number;
|
|
9408
|
+
return_taxable_subtotal?: number;
|
|
9409
|
+
return_net_total?: number;
|
|
9410
|
+
return_tax_amount?: number;
|
|
9411
|
+
return_tax_amount_after_deduction_float?: number;
|
|
9412
|
+
return_tax_amount_after_deduction_float_rounded?: number;
|
|
9413
|
+
return_tax_amount_after_deduction_float_rounded_sum?: number;
|
|
9414
|
+
return_total?: number;
|
|
9415
|
+
return_total_float?: number;
|
|
9416
|
+
return_total_float_rounded?: number;
|
|
9417
|
+
return_total_float_rounded_sum?: number;
|
|
9418
|
+
return_total_before_tax?: number;
|
|
9419
|
+
return_taxable_amount_float?: number;
|
|
9420
|
+
return_taxable_amount_float_rounded?: number;
|
|
9421
|
+
return_taxable_amount_float_rounded_sum?: number;
|
|
9422
|
+
deductionRatio?: number;
|
|
9423
|
+
deductionFixed?: number;
|
|
9424
|
+
totalDeductedTax?: number;
|
|
9425
|
+
totalDeductedTaxFloat?: number;
|
|
9426
|
+
totalDeduction?: number;
|
|
9427
|
+
totalDeductionFloat?: number;
|
|
9428
|
+
totalDeductionBeforeTax?: number;
|
|
9429
|
+
totalDeductionBeforeTaxFloat?: number;
|
|
9430
|
+
totalAfterDeduction?: number;
|
|
9431
|
+
totalAfterDeductionFloat?: number;
|
|
9432
|
+
lines_discount?: number;
|
|
9433
|
+
lines_discount_float?: number;
|
|
9434
|
+
taxes: { [key: string]: any };
|
|
9435
|
+
overwriteDeductionFixed?: number;
|
|
9436
|
+
overwriteTaxExempt?: boolean;
|
|
9437
|
+
tax_exempt?: boolean;
|
|
9438
|
+
overwriteDeductionRatio?: number;
|
|
9439
|
+
shipping_zone?: { [key: string]: any };
|
|
9440
|
+
payment_method?: { [key: string]: any };
|
|
9441
|
+
shipping_price?: number;
|
|
9442
|
+
shipping_tax?: number;
|
|
9443
|
+
shipping_charge?: number;
|
|
9444
|
+
payment_charge?: number;
|
|
9445
|
+
total_with_charges?: number;
|
|
9446
|
+
payment?: { amount?: number };
|
|
9447
|
+
workorder?: string;
|
|
9448
|
+
asset?: string;
|
|
9449
|
+
asset_unit?: string;
|
|
9450
|
+
signature?: string;
|
|
9451
|
+
createdAt: Date;
|
|
9452
|
+
updatedAt: Date;
|
|
9453
|
+
items: (Item.Schema & { notes?: { [key: string]: any } })[];
|
|
9454
|
+
return_items?: (Item.Schema & { notes?: { [key: string]: any } })[];
|
|
9455
|
+
invoice_payment_type: "cash" | "credit";
|
|
9456
|
+
total_items_base_unit_qty?: number;
|
|
9457
|
+
total_items_qty?: number;
|
|
9458
|
+
total_return_items_base_unit_qty?: number;
|
|
9459
|
+
total_return_items_qty?: number;
|
|
9460
|
+
cart?: { [key: string]: any };
|
|
9461
|
+
}
|
|
9462
|
+
export namespace Find {
|
|
9463
|
+
export type Params = DefaultPaginationQueryParams & {
|
|
9464
|
+
client_id?: string;
|
|
9465
|
+
type?: string;
|
|
9466
|
+
};
|
|
9467
|
+
export interface Result extends DefaultPaginationResult {
|
|
9468
|
+
data: Data[];
|
|
9469
|
+
}
|
|
9470
|
+
}
|
|
9471
|
+
export namespace Get {
|
|
9472
|
+
export type ID = string;
|
|
9473
|
+
export type Result = Data;
|
|
9474
|
+
}
|
|
9475
|
+
export namespace Create {
|
|
9476
|
+
export type Body = CreateBody;
|
|
9477
|
+
export type Result = Data;
|
|
9478
|
+
}
|
|
9479
|
+
}
|
|
9480
|
+
|
|
9481
|
+
export namespace OcrInvoiceJobTemplate {
|
|
9482
|
+
export interface ProductMatchStage {
|
|
9483
|
+
model: "products" | "productvariations" | "ocrInvoiceJobPages";
|
|
9484
|
+
model_key:
|
|
9485
|
+
| "name"
|
|
9486
|
+
| "barcode"
|
|
9487
|
+
| "sku"
|
|
9488
|
+
| "ai_json_data.barcode"
|
|
9489
|
+
| "ai_json_data.code"
|
|
9490
|
+
| "ai_json_data.description";
|
|
9491
|
+
operator: "eq";
|
|
9492
|
+
ai_json_key: "barcode" | "code" | "description";
|
|
9493
|
+
condition: "learn_ignorance";
|
|
9494
|
+
warning_message: string;
|
|
9495
|
+
is_warning: boolean;
|
|
9496
|
+
}
|
|
9497
|
+
|
|
9498
|
+
export interface MeasureUnitMatchStage {
|
|
9499
|
+
model: "measureunits";
|
|
9500
|
+
quick_action: "product_default" | "base_measure_unit";
|
|
9501
|
+
condition: "eq_product_default" | "in_product_family";
|
|
9502
|
+
model_key: "name";
|
|
9503
|
+
operator: "eq";
|
|
9504
|
+
ai_json_key: "measure_unit";
|
|
9505
|
+
warning_message: string;
|
|
9506
|
+
is_warning: boolean;
|
|
9507
|
+
}
|
|
9508
|
+
|
|
9509
|
+
export interface ClientMatchingStage {
|
|
9510
|
+
model: "clients" | "ocrInvoiceJobPages";
|
|
9511
|
+
condition?: "in_current_template";
|
|
9512
|
+
model_key: "name" | "ai_invoice_json.client_name";
|
|
9513
|
+
operator: "eq";
|
|
9514
|
+
ai_json_key: "client_name";
|
|
9515
|
+
warning_message?: string;
|
|
9516
|
+
is_warning?: boolean;
|
|
9517
|
+
}
|
|
9518
|
+
|
|
9519
|
+
export interface CartOptions {
|
|
9520
|
+
overwrite_price: boolean;
|
|
9521
|
+
client_override?: boolean;
|
|
9522
|
+
product_matching_stages: ProductMatchStage[];
|
|
9523
|
+
measure_unit_matching_stages: MeasureUnitMatchStage[];
|
|
9524
|
+
client_matching_stages: ClientMatchingStage[];
|
|
9525
|
+
}
|
|
9526
|
+
|
|
9527
|
+
export interface Data {
|
|
9528
|
+
_id: StringId;
|
|
9529
|
+
name: string;
|
|
9530
|
+
company_namespace: string[];
|
|
9531
|
+
disabled: boolean;
|
|
9532
|
+
document_scan_listed: boolean;
|
|
9533
|
+
client?: StringId;
|
|
9534
|
+
doc_type: "pdf" | "image";
|
|
9535
|
+
preparation_option?: {
|
|
9536
|
+
rotate?: boolean;
|
|
9537
|
+
convert_to_image: boolean;
|
|
9538
|
+
lang?: {
|
|
9539
|
+
en?: boolean;
|
|
9540
|
+
ar?: boolean;
|
|
9541
|
+
};
|
|
9542
|
+
};
|
|
9543
|
+
cart_option?: CartOptions;
|
|
9544
|
+
ai_json_parsing_model: "gpt-4o-mini" | "gpt-4o";
|
|
9545
|
+
ai_vision_model: "gpt-4o-mini" | "gpt-4o" | "local_vision";
|
|
9546
|
+
visible_columns: {
|
|
9547
|
+
key:
|
|
9548
|
+
| "product_name"
|
|
9549
|
+
| "variant_name"
|
|
9550
|
+
| "product_sku"
|
|
9551
|
+
| "product_barcode"
|
|
9552
|
+
| "variant_barcode"
|
|
9553
|
+
| "variant_sku"
|
|
9554
|
+
| "price"
|
|
9555
|
+
| "qty"
|
|
9556
|
+
| "measure_unit"
|
|
9557
|
+
| "total_amount"
|
|
9558
|
+
| "total"
|
|
9559
|
+
| "code";
|
|
9560
|
+
visible: boolean;
|
|
9561
|
+
}[];
|
|
9562
|
+
ai_parsing_prompt_amendment?: string;
|
|
9563
|
+
ai_vision_prompt_amendment?: string;
|
|
9564
|
+
ai_parsing_prompt_overwrite?: string;
|
|
9565
|
+
ai_vision_prompt_overwrite?: string;
|
|
9566
|
+
enable_ai_parsing_prompt_amendment?: boolean;
|
|
9567
|
+
enable_ai_vision_prompt_amendment?: boolean;
|
|
9568
|
+
enable_ai_parsing_prompt_overwrite?: boolean;
|
|
9569
|
+
enable_ai_vision_prompt_overwrite?: boolean;
|
|
9570
|
+
always_merge_pages_for_job?: boolean;
|
|
9571
|
+
trim_barcode_zero_from_left?: boolean;
|
|
9572
|
+
createdAt: Date;
|
|
9573
|
+
updatedAt: Date;
|
|
9574
|
+
}
|
|
9575
|
+
export interface PopulatedDoc {
|
|
9576
|
+
_id: StringId;
|
|
9577
|
+
name: string;
|
|
9578
|
+
company_namespace: string[];
|
|
9579
|
+
disabled: boolean;
|
|
9580
|
+
document_scan_listed: boolean;
|
|
9581
|
+
client?: StringId;
|
|
9582
|
+
client_populated?: Pick<Client.ClientSchema, "name" | "_id">;
|
|
9583
|
+
doc_type: "pdf" | "image";
|
|
9584
|
+
preparation_option?: {
|
|
9585
|
+
rotate?: boolean;
|
|
9586
|
+
convert_to_image: boolean;
|
|
9587
|
+
lang?: {
|
|
9588
|
+
en?: boolean;
|
|
9589
|
+
ar?: boolean;
|
|
9590
|
+
};
|
|
9591
|
+
};
|
|
9592
|
+
cart_option?: CartOptions;
|
|
9593
|
+
ai_json_parsing_model: "gpt-4o-mini" | "gpt-4o";
|
|
9594
|
+
ai_vision_model: "gpt-4o-mini" | "gpt-4o" | "local_vision";
|
|
9595
|
+
visible_columns: {
|
|
9596
|
+
key:
|
|
9597
|
+
| "product_name"
|
|
9598
|
+
| "variant_name"
|
|
9599
|
+
| "product_sku"
|
|
9600
|
+
| "product_barcode"
|
|
9601
|
+
| "variant_barcode"
|
|
9602
|
+
| "variant_sku"
|
|
9603
|
+
| "price"
|
|
9604
|
+
| "qty"
|
|
9605
|
+
| "measure_unit"
|
|
9606
|
+
| "total_amount"
|
|
9607
|
+
| "total"
|
|
9608
|
+
| "code";
|
|
9609
|
+
visible: boolean;
|
|
9610
|
+
}[];
|
|
9611
|
+
ai_parsing_prompt_amendment?: string;
|
|
9612
|
+
ai_vision_prompt_amendment?: string;
|
|
9613
|
+
ai_parsing_prompt_overwrite?: string;
|
|
9614
|
+
ai_vision_prompt_overwrite?: string;
|
|
9615
|
+
enable_ai_parsing_prompt_amendment?: boolean;
|
|
9616
|
+
enable_ai_vision_prompt_amendment?: boolean;
|
|
9617
|
+
enable_ai_parsing_prompt_overwrite?: boolean;
|
|
9618
|
+
enable_ai_vision_prompt_overwrite?: boolean;
|
|
9619
|
+
always_merge_pages_for_job?: boolean;
|
|
9620
|
+
trim_zero_from_first?: boolean;
|
|
9621
|
+
createdAt: Date;
|
|
9622
|
+
updatedAt: Date;
|
|
9623
|
+
}
|
|
9624
|
+
export interface CreateBody {
|
|
9625
|
+
name: string;
|
|
9626
|
+
company_namespace: string[];
|
|
9627
|
+
document_scan_listed: boolean;
|
|
9628
|
+
client?: StringId;
|
|
9629
|
+
doc_type: "pdf" | "image";
|
|
9630
|
+
preparation_option?: {
|
|
9631
|
+
rotate?: boolean;
|
|
9632
|
+
convert_to_image: boolean;
|
|
9633
|
+
lang?: {
|
|
9634
|
+
en?: boolean;
|
|
9635
|
+
ar?: boolean;
|
|
9636
|
+
};
|
|
9637
|
+
};
|
|
9638
|
+
cart_option?: CartOptions;
|
|
9639
|
+
ai_json_parsing_model: "gpt-4o-mini" | "gpt-4o";
|
|
9640
|
+
ai_vision_model: "gpt-4o-mini" | "gpt-4o" | "local_vision";
|
|
9641
|
+
visible_columns: {
|
|
9642
|
+
key:
|
|
9643
|
+
| "product_name"
|
|
9644
|
+
| "variant_name"
|
|
9645
|
+
| "product_sku"
|
|
9646
|
+
| "product_barcode"
|
|
9647
|
+
| "variant_barcode"
|
|
9648
|
+
| "variant_sku"
|
|
9649
|
+
| "price"
|
|
9650
|
+
| "qty"
|
|
9651
|
+
| "measure_unit"
|
|
9652
|
+
| "total_amount"
|
|
9653
|
+
| "total"
|
|
9654
|
+
| "code";
|
|
9655
|
+
visible: boolean;
|
|
9656
|
+
}[];
|
|
9657
|
+
ai_parsing_prompt_amendment?: string;
|
|
9658
|
+
ai_vision_prompt_amendment?: string;
|
|
9659
|
+
ai_parsing_prompt_overwrite?: string;
|
|
9660
|
+
ai_vision_prompt_overwrite?: string;
|
|
9661
|
+
enable_ai_parsing_prompt_amendment?: boolean;
|
|
9662
|
+
enable_ai_vision_prompt_amendment?: boolean;
|
|
9663
|
+
enable_ai_parsing_prompt_overwrite?: boolean;
|
|
9664
|
+
enable_ai_vision_prompt_overwrite?: boolean;
|
|
9665
|
+
always_merge_pages_for_job?: boolean;
|
|
9666
|
+
trim_zero_from_first?: boolean;
|
|
9667
|
+
}
|
|
9668
|
+
export interface UpdateBody {
|
|
9669
|
+
name: string;
|
|
9670
|
+
company_namespace: string[];
|
|
9671
|
+
document_scan_listed: boolean;
|
|
9672
|
+
client?: StringId;
|
|
9673
|
+
preparation_option?: {
|
|
9674
|
+
rotate?: boolean;
|
|
9675
|
+
convert_to_image: boolean;
|
|
9676
|
+
lang?: {
|
|
9677
|
+
en?: boolean;
|
|
9678
|
+
ar?: boolean;
|
|
9679
|
+
};
|
|
9680
|
+
};
|
|
9681
|
+
cart_option?: CartOptions;
|
|
9682
|
+
ai_json_parsing_model: "gpt-4o-mini" | "gpt-4o";
|
|
9683
|
+
ai_vision_model: "gpt-4o-mini" | "gpt-4o" | "local_vision";
|
|
9684
|
+
visible_columns: {
|
|
9685
|
+
key:
|
|
9686
|
+
| "product_name"
|
|
9687
|
+
| "variant_name"
|
|
9688
|
+
| "product_sku"
|
|
9689
|
+
| "product_barcode"
|
|
9690
|
+
| "variant_barcode"
|
|
9691
|
+
| "variant_sku"
|
|
9692
|
+
| "price"
|
|
9693
|
+
| "qty"
|
|
9694
|
+
| "measure_unit"
|
|
9695
|
+
| "total_amount"
|
|
9696
|
+
| "total"
|
|
9697
|
+
| "code";
|
|
9698
|
+
visible: boolean;
|
|
9699
|
+
}[];
|
|
9700
|
+
ai_parsing_prompt_amendment?: string;
|
|
9701
|
+
ai_vision_prompt_amendment?: string;
|
|
9702
|
+
ai_parsing_prompt_overwrite?: string;
|
|
9703
|
+
ai_vision_prompt_overwrite?: string;
|
|
9704
|
+
enable_ai_parsing_prompt_amendment?: boolean;
|
|
9705
|
+
enable_ai_vision_prompt_amendment?: boolean;
|
|
9706
|
+
enable_ai_parsing_prompt_overwrite?: boolean;
|
|
9707
|
+
enable_ai_vision_prompt_overwrite?: boolean;
|
|
9708
|
+
always_merge_pages_for_job?: boolean;
|
|
9709
|
+
trim_zero_from_first?: boolean;
|
|
9710
|
+
}
|
|
9711
|
+
|
|
9712
|
+
export namespace Find {
|
|
9713
|
+
export type Params = DefaultPaginationQueryParams & {
|
|
9714
|
+
_id?: StringId[] | StringId;
|
|
9715
|
+
client?: string[] | string;
|
|
9716
|
+
disabled?: boolean;
|
|
9717
|
+
doc_type?: string[] | string;
|
|
9718
|
+
};
|
|
9719
|
+
export interface Result extends DefaultPaginationResult {
|
|
9720
|
+
data: Data[] | PopulatedDoc[];
|
|
9721
|
+
}
|
|
9722
|
+
}
|
|
9723
|
+
export namespace Get {
|
|
9724
|
+
export type ID = string;
|
|
9725
|
+
export type Result = Data | PopulatedDoc;
|
|
9726
|
+
}
|
|
9727
|
+
export namespace Create {
|
|
9728
|
+
export type Body = CreateBody;
|
|
9729
|
+
export type Result = Data;
|
|
9730
|
+
}
|
|
9731
|
+
export namespace Update {
|
|
9732
|
+
export type ID = string;
|
|
9733
|
+
export type Body = UpdateBody;
|
|
9734
|
+
export type Result = Data;
|
|
9735
|
+
}
|
|
9736
|
+
}
|
|
9737
|
+
|
|
9738
|
+
export namespace OcrInvoiceJobGroup {
|
|
9739
|
+
export interface Data {
|
|
9740
|
+
_id: StringId;
|
|
9741
|
+
name: string;
|
|
9742
|
+
sync_id: string;
|
|
9743
|
+
company_namespace: string[];
|
|
9744
|
+
disabled: boolean;
|
|
9745
|
+
template: StringId;
|
|
9746
|
+
client: StringId | Pick<Client.ClientSchema, "name">;
|
|
9747
|
+
doc_type: "pdf" | "image";
|
|
9748
|
+
media: string[];
|
|
9749
|
+
creator: AdminOrRep;
|
|
9750
|
+
status:
|
|
9751
|
+
| "initiated"
|
|
9752
|
+
| "failed"
|
|
9753
|
+
| "incomplete"
|
|
9754
|
+
| "partially_completed"
|
|
9755
|
+
| "completed"
|
|
9756
|
+
| "in_progress";
|
|
9757
|
+
time: number;
|
|
9758
|
+
visit_id?: StringId;
|
|
9759
|
+
geo_tag: GeoTag;
|
|
9760
|
+
}
|
|
9761
|
+
export interface PopulatedDoc {
|
|
9762
|
+
_id: StringId;
|
|
9763
|
+
name: string;
|
|
9764
|
+
sync_id: string;
|
|
9765
|
+
company_namespace: string[];
|
|
9766
|
+
disabled: boolean;
|
|
9767
|
+
template: StringId;
|
|
9768
|
+
template_poplated: OcrInvoiceJobTemplate.Data;
|
|
9769
|
+
client: StringId;
|
|
9770
|
+
client_populated: Pick<Client.ClientSchema, "name" | "_id">;
|
|
9771
|
+
doc_type: "pdf" | "image";
|
|
9772
|
+
media: StringId[];
|
|
9773
|
+
media_populated: PopulatedMediaStorage[];
|
|
9774
|
+
creator: AdminOrRep;
|
|
9775
|
+
status:
|
|
9776
|
+
| "initiated"
|
|
9777
|
+
| "failed"
|
|
9778
|
+
| "incomplete"
|
|
9779
|
+
| "partially_completed"
|
|
9780
|
+
| "completed"
|
|
9781
|
+
| "in_progress";
|
|
9782
|
+
time: number;
|
|
9783
|
+
visit_id?: StringId;
|
|
9784
|
+
geo_tag: GeoTag;
|
|
9785
|
+
}
|
|
9786
|
+
export interface CreateBody {
|
|
9787
|
+
sync_id: string;
|
|
9788
|
+
name: string;
|
|
9789
|
+
company_namespace: string[];
|
|
9790
|
+
template: StringId;
|
|
9791
|
+
client: StringId;
|
|
9792
|
+
media: StringId[];
|
|
9793
|
+
creator?: AdminOrRep;
|
|
9794
|
+
time: number;
|
|
9795
|
+
visit_id?: StringId;
|
|
9796
|
+
geo_tag?: GeoTag;
|
|
9797
|
+
}
|
|
9798
|
+
|
|
9799
|
+
export namespace Find {
|
|
9800
|
+
export type Params = DefaultPaginationQueryParams & {
|
|
9801
|
+
_id?: StringId[] | StringId;
|
|
9802
|
+
client?: string[] | string;
|
|
9803
|
+
disabled?: boolean;
|
|
9804
|
+
doc_type?: string[] | string;
|
|
9805
|
+
template?: StringId[] | StringId;
|
|
9806
|
+
visit_id?: StringId[] | StringId;
|
|
9807
|
+
from_time?: number;
|
|
9808
|
+
to_time?: number;
|
|
9809
|
+
status: string[];
|
|
9810
|
+
rep?: StringId[] | StringId;
|
|
9811
|
+
admin?: StringId[] | StringId;
|
|
9812
|
+
"creator._id"?: StringId[] | StringId;
|
|
9813
|
+
"creator.type"?: string[] | string;
|
|
9814
|
+
search?: string;
|
|
9815
|
+
};
|
|
9816
|
+
export interface Result extends DefaultPaginationResult {
|
|
9817
|
+
data: Data[] | PopulatedDoc[];
|
|
9818
|
+
}
|
|
9819
|
+
}
|
|
9820
|
+
export namespace Get {
|
|
9821
|
+
export type ID = string;
|
|
9822
|
+
export type Result = Data | PopulatedDoc;
|
|
9823
|
+
}
|
|
9824
|
+
export namespace Create {
|
|
9825
|
+
export type Body = CreateBody;
|
|
9826
|
+
export type Result = Data;
|
|
9827
|
+
}
|
|
9828
|
+
}
|
|
9829
|
+
|
|
9830
|
+
export namespace OcrInvoiceJob {
|
|
9831
|
+
export type StepCode = "ai-api-js" | "python-utilities" | "job-handler";
|
|
9832
|
+
export type TaskCode =
|
|
9833
|
+
| "create-job-pages"
|
|
9834
|
+
| "photo-json-extraction"
|
|
9835
|
+
| "photo-text-extraction"
|
|
9836
|
+
| "pdf-text-extraction"
|
|
9837
|
+
| "text-json-parsing"
|
|
9838
|
+
| "pdf-image-conversion"
|
|
9839
|
+
| "pdf-image-text-ocr"
|
|
9840
|
+
| "finalize";
|
|
9841
|
+
|
|
9842
|
+
export interface Task {
|
|
9843
|
+
code: TaskCode;
|
|
9844
|
+
options: {};
|
|
9845
|
+
}
|
|
9846
|
+
|
|
9847
|
+
export type Step = {
|
|
9848
|
+
code: StepCode;
|
|
9849
|
+
tasks: Task[];
|
|
9850
|
+
};
|
|
9851
|
+
|
|
9852
|
+
export interface PhotoTextExtractionTask extends Task {
|
|
9853
|
+
code: "photo-text-extraction";
|
|
9854
|
+
options: {};
|
|
9855
|
+
}
|
|
9856
|
+
|
|
9857
|
+
export interface PhotoJsonExtractionTask extends Task {
|
|
9858
|
+
code: "photo-json-extraction";
|
|
9859
|
+
options: { ai_model: "gpt-4o-mini" | "gpt-4o" };
|
|
9860
|
+
}
|
|
9861
|
+
|
|
9862
|
+
export interface PdfTextExtractionTask extends Task {
|
|
9863
|
+
code: "pdf-text-extraction";
|
|
9864
|
+
options: {};
|
|
9865
|
+
}
|
|
9866
|
+
|
|
9867
|
+
export interface PdfImageConversionTask extends Task {
|
|
9868
|
+
code: "pdf-image-conversion";
|
|
9869
|
+
options: {};
|
|
9870
|
+
}
|
|
9871
|
+
|
|
9872
|
+
export interface PdfImageTextOcrTask extends Task {
|
|
9873
|
+
code: "pdf-image-text-ocr";
|
|
9874
|
+
options: {};
|
|
9875
|
+
}
|
|
9876
|
+
|
|
9877
|
+
export interface TextJsonParsingTask extends Task {
|
|
9878
|
+
code: "text-json-parsing";
|
|
9879
|
+
options: { ai_model: "gpt-4o-mini" | "gpt-4o" };
|
|
9880
|
+
}
|
|
9881
|
+
|
|
9882
|
+
export interface FinalizeTask extends Task {
|
|
9883
|
+
code: "finalize";
|
|
9884
|
+
options: {};
|
|
9885
|
+
}
|
|
9886
|
+
|
|
9887
|
+
export interface CreateJobPagesTask extends Task {
|
|
9888
|
+
code: "create-job-pages";
|
|
9889
|
+
options: {};
|
|
9890
|
+
}
|
|
9891
|
+
|
|
9892
|
+
export type AiApiJsStep = {
|
|
9893
|
+
code: "ai-api-js";
|
|
9894
|
+
tasks: (
|
|
9895
|
+
| PhotoTextExtractionTask
|
|
9896
|
+
| PhotoJsonExtractionTask
|
|
9897
|
+
| TextJsonParsingTask
|
|
9898
|
+
)[];
|
|
9899
|
+
};
|
|
9900
|
+
|
|
9901
|
+
export type PythonUtilitiesStep = {
|
|
9902
|
+
code: "python-utilities";
|
|
9903
|
+
tasks: (
|
|
9904
|
+
| PdfTextExtractionTask
|
|
9905
|
+
| PdfImageConversionTask
|
|
9906
|
+
| PdfImageTextOcrTask
|
|
9907
|
+
)[];
|
|
9908
|
+
};
|
|
9909
|
+
|
|
9910
|
+
export type JobHandlerStep = {
|
|
9911
|
+
code: "job-handler";
|
|
9912
|
+
tasks: (FinalizeTask | CreateJobPagesTask | TextJsonParsingTask)[];
|
|
9913
|
+
};
|
|
9914
|
+
|
|
9915
|
+
export type PlanStep = AiApiJsStep | JobHandlerStep | PythonUtilitiesStep;
|
|
9916
|
+
type PlanOptions = {
|
|
9917
|
+
early_page_generation?: boolean;
|
|
9918
|
+
};
|
|
9919
|
+
|
|
9920
|
+
export type Plan = {
|
|
9921
|
+
steps: PlanStep[];
|
|
9922
|
+
options: PlanOptions;
|
|
9923
|
+
};
|
|
9924
|
+
|
|
9925
|
+
export interface Data {
|
|
9926
|
+
_id: StringId;
|
|
9927
|
+
company_namespace: string[];
|
|
9928
|
+
disabled: boolean;
|
|
9929
|
+
template: StringId;
|
|
9930
|
+
client: StringId;
|
|
9931
|
+
doc_type: "pdf" | "image";
|
|
9932
|
+
convert_to_image?: boolean;
|
|
9933
|
+
rotate?: boolean;
|
|
9934
|
+
file_media: StringId;
|
|
9935
|
+
text_media?: StringId;
|
|
9936
|
+
pages_count?: number;
|
|
9937
|
+
createdAt: Date;
|
|
9938
|
+
updatedAt: Date;
|
|
9939
|
+
job_group: StringId;
|
|
9940
|
+
planner?: Plan;
|
|
9941
|
+
status:
|
|
9942
|
+
| "pending"
|
|
9943
|
+
| "initiated"
|
|
9944
|
+
| "incomplete"
|
|
9945
|
+
| "in_progress"
|
|
9946
|
+
| "completed"
|
|
9947
|
+
| "failed";
|
|
9948
|
+
creator: AdminOrRep;
|
|
9949
|
+
error_message?: any;
|
|
9950
|
+
}
|
|
9951
|
+
export interface PopulatedDoc {
|
|
9952
|
+
_id: StringId;
|
|
9953
|
+
company_namespace: string[];
|
|
9954
|
+
disabled: boolean;
|
|
9955
|
+
template: StringId;
|
|
9956
|
+
template_populated: Pick<OcrInvoiceJobTemplate.Data, "name" | "_id">;
|
|
9957
|
+
client: StringId;
|
|
9958
|
+
client_populated: Pick<Client.ClientSchema, "name" | "_id">;
|
|
9959
|
+
doc_type: "pdf" | "image";
|
|
9960
|
+
convert_to_image?: boolean;
|
|
9961
|
+
rotate?: boolean;
|
|
9962
|
+
file_media: StringId | PopulatedMediaStorage;
|
|
9963
|
+
file_media_populated: PopulatedMediaStorage;
|
|
9964
|
+
text_media?: StringId;
|
|
9965
|
+
pages_count?: number;
|
|
9966
|
+
createdAt: Date;
|
|
9967
|
+
updatedAt: Date;
|
|
9968
|
+
job_group: StringId;
|
|
9969
|
+
job_group_populated: Pick<OcrInvoiceJobGroup.Data, "name" | "_id">;
|
|
9970
|
+
planner?: Plan;
|
|
9971
|
+
status:
|
|
9972
|
+
| "pending"
|
|
9973
|
+
| "initiated"
|
|
9974
|
+
| "incomplete"
|
|
9975
|
+
| "in_progress"
|
|
9976
|
+
| "completed"
|
|
9977
|
+
| "failed";
|
|
9978
|
+
creator: AdminOrRep;
|
|
9979
|
+
error_message?: any;
|
|
9980
|
+
}
|
|
9981
|
+
export namespace Find {
|
|
9982
|
+
export type Params = DefaultPaginationQueryParams & {
|
|
9983
|
+
_id?: StringId[] | StringId;
|
|
9984
|
+
disabled?: boolean;
|
|
9985
|
+
template: StringId[] | StringId;
|
|
9986
|
+
client?: StringId[] | StringId;
|
|
9987
|
+
doc_type?: string[] | string;
|
|
9988
|
+
job_group?: StringId[] | StringId;
|
|
9989
|
+
};
|
|
9990
|
+
export interface Result extends DefaultPaginationResult {
|
|
9991
|
+
data: Data[] | PopulatedDoc[];
|
|
9992
|
+
}
|
|
9993
|
+
}
|
|
9994
|
+
export namespace Get {
|
|
9995
|
+
export type ID = string;
|
|
9996
|
+
export type Result = Data | PopulatedDoc;
|
|
9997
|
+
}
|
|
9998
|
+
}
|
|
9999
|
+
|
|
10000
|
+
export namespace OcrInvoiceJobPage {
|
|
10001
|
+
export interface AIInvoiceJsonSchema {
|
|
10002
|
+
new_page?: boolean;
|
|
10003
|
+
issue_date?: string;
|
|
10004
|
+
reference?: string;
|
|
10005
|
+
client_name?: string;
|
|
10006
|
+
items: [
|
|
10007
|
+
{
|
|
10008
|
+
barcode?: string;
|
|
10009
|
+
code?: string;
|
|
10010
|
+
description?: string;
|
|
10011
|
+
quantity?: number;
|
|
10012
|
+
unit_price?: number;
|
|
10013
|
+
total?: number;
|
|
10014
|
+
measure_unit?: string;
|
|
10015
|
+
total_amount?: number;
|
|
10016
|
+
tax_amount?: number;
|
|
10017
|
+
discount_amount?: number;
|
|
10018
|
+
}
|
|
10019
|
+
];
|
|
10020
|
+
total_amount?: number;
|
|
10021
|
+
total_tax?: number;
|
|
10022
|
+
}
|
|
10023
|
+
|
|
10024
|
+
export interface CartAnnotationErrorType {
|
|
10025
|
+
message: string;
|
|
10026
|
+
key:
|
|
10027
|
+
| "items.variant.listed_price"
|
|
10028
|
+
| "items.overwrite_price"
|
|
10029
|
+
| "items.tax"
|
|
10030
|
+
| "items.measure_unit"
|
|
10031
|
+
| "items.qty"
|
|
10032
|
+
| "items.variant.variant_sku"
|
|
10033
|
+
| "items.variant.variant_barcode"
|
|
10034
|
+
| "items.variant.product_barcode"
|
|
10035
|
+
| "items.variant.product_sku"
|
|
10036
|
+
| "items.cart_line_total"
|
|
10037
|
+
| "items.cart_line_amount"
|
|
10038
|
+
| "items.variant.product_id"
|
|
10039
|
+
| "items.variant.variant_id"
|
|
10040
|
+
| "total"
|
|
10041
|
+
| "tax_total"
|
|
10042
|
+
| "issue_date"
|
|
10043
|
+
| "external_serial_number"
|
|
10044
|
+
| "client";
|
|
10045
|
+
code:
|
|
10046
|
+
| "missing"
|
|
10047
|
+
| "not_equal"
|
|
10048
|
+
| "exists"
|
|
10049
|
+
| "invalid_date"
|
|
10050
|
+
| "custom_warning";
|
|
10051
|
+
}
|
|
10052
|
+
|
|
10053
|
+
export interface CartAnnotationItem {
|
|
10054
|
+
ai_json_data?: {
|
|
10055
|
+
barcode?: string;
|
|
10056
|
+
description?: string;
|
|
10057
|
+
qty?: number;
|
|
10058
|
+
measure_unit?: string;
|
|
10059
|
+
code?: string;
|
|
10060
|
+
unit_price?: number;
|
|
10061
|
+
total?: number;
|
|
10062
|
+
total_amount?: number;
|
|
10063
|
+
tax_amount?: number;
|
|
10064
|
+
discount_amount?: number;
|
|
10065
|
+
};
|
|
10066
|
+
overwrite_price?: number;
|
|
10067
|
+
client_id: StringId;
|
|
10068
|
+
qty: number;
|
|
10069
|
+
variant?: {
|
|
10070
|
+
product_id?: string;
|
|
10071
|
+
product_name?: string;
|
|
10072
|
+
product_sku?: string;
|
|
10073
|
+
product_barcode?: string;
|
|
10074
|
+
variant_id?: string;
|
|
10075
|
+
variant_name?: string;
|
|
10076
|
+
variant_sku?: string;
|
|
10077
|
+
variant_barcode?: string;
|
|
10078
|
+
listed_price?: number;
|
|
10079
|
+
};
|
|
10080
|
+
measure_unit?: {
|
|
10081
|
+
parent: string;
|
|
10082
|
+
name: string;
|
|
10083
|
+
factor: number;
|
|
10084
|
+
disabled: boolean;
|
|
10085
|
+
company_namespace: string[];
|
|
10086
|
+
};
|
|
10087
|
+
tax?: {
|
|
10088
|
+
name: string;
|
|
10089
|
+
rate: number;
|
|
10090
|
+
type: "inclusive" | "additive" | "N/A";
|
|
10091
|
+
ubl_tax_details?: {
|
|
10092
|
+
tax_code: { type: String; enum: ["Z", "O", "S", "E"] };
|
|
10093
|
+
reason: { type: String };
|
|
10094
|
+
reason_code: { type: String };
|
|
10095
|
+
};
|
|
10096
|
+
disabled: boolean;
|
|
10097
|
+
};
|
|
10098
|
+
warnings?: CartAnnotationErrorType[];
|
|
10099
|
+
_errors?: CartAnnotationErrorType[];
|
|
10100
|
+
status?: "red" | "green" | "orange";
|
|
10101
|
+
cart_line_total?: number;
|
|
10102
|
+
cart_line_amount?: number;
|
|
10103
|
+
ignore?: boolean;
|
|
10104
|
+
}
|
|
10105
|
+
|
|
10106
|
+
export interface CartAnnotation {
|
|
10107
|
+
issue_date: string;
|
|
10108
|
+
external_serial_number?: string;
|
|
10109
|
+
total: number;
|
|
10110
|
+
tax_total: number;
|
|
10111
|
+
cart_total: number;
|
|
10112
|
+
cart_tax_total: number;
|
|
10113
|
+
cart_total_before_tax: number;
|
|
10114
|
+
items: CartAnnotationItem[];
|
|
10115
|
+
warnings?: CartAnnotationErrorType[];
|
|
10116
|
+
_errors?: CartAnnotationErrorType[];
|
|
10117
|
+
status?: "red" | "orange" | "green";
|
|
10118
|
+
}
|
|
10119
|
+
|
|
10120
|
+
export interface Data {
|
|
10121
|
+
_id: string;
|
|
10122
|
+
company_namespace: string[];
|
|
10123
|
+
disabled: boolean;
|
|
10124
|
+
job: StringId;
|
|
10125
|
+
template: StringId;
|
|
10126
|
+
page_number: number;
|
|
10127
|
+
text?: string;
|
|
10128
|
+
media_url?: string;
|
|
10129
|
+
proforma?: StringId;
|
|
10130
|
+
cart?: Cart.Data;
|
|
10131
|
+
cart_annotation?: CartAnnotation;
|
|
10132
|
+
ai_invoice_json?: AIInvoiceJsonSchema;
|
|
10133
|
+
error_message?: any;
|
|
10134
|
+
client: StringId;
|
|
10135
|
+
status?:
|
|
10136
|
+
| "pending"
|
|
10137
|
+
| "in_progress"
|
|
10138
|
+
| "converted"
|
|
10139
|
+
| "failed"
|
|
10140
|
+
| "ready_to_convert"
|
|
10141
|
+
| "incomplete"
|
|
10142
|
+
| "merged";
|
|
10143
|
+
last_page: boolean;
|
|
10144
|
+
creator: AdminOrRep;
|
|
10145
|
+
editor?: AdminOrRep;
|
|
10146
|
+
createdAt: Date;
|
|
10147
|
+
updatedAt: Date;
|
|
10148
|
+
}
|
|
10149
|
+
export interface PopulatedDoc {
|
|
10150
|
+
_id: StringId;
|
|
10151
|
+
company_namespace: string[];
|
|
10152
|
+
disabled: boolean;
|
|
10153
|
+
job: StringId;
|
|
10154
|
+
job_populated: OcrInvoiceJob.Data & {
|
|
10155
|
+
job_group_populated: OcrInvoiceJobGroup.Data;
|
|
10156
|
+
};
|
|
10157
|
+
template: StringId;
|
|
10158
|
+
template_populated: Pick<OcrInvoiceJobTemplate.Data, "name" | "_id">;
|
|
10159
|
+
page_number: number;
|
|
10160
|
+
text?: string;
|
|
10161
|
+
media_url?: string;
|
|
10162
|
+
proforma?: StringId;
|
|
10163
|
+
proforma_populated?: Pick<
|
|
10164
|
+
Proforma.ProformaSchema,
|
|
10165
|
+
"serial_number" | "_id"
|
|
10166
|
+
>;
|
|
10167
|
+
cart?: Cart.Data;
|
|
10168
|
+
cart_annotation?: CartAnnotation;
|
|
10169
|
+
ai_invoice_json?: AIInvoiceJsonSchema;
|
|
10170
|
+
error_message?: any;
|
|
10171
|
+
client: StringId;
|
|
10172
|
+
client_populated: Pick<Client.ClientSchema, "_id" | "name">;
|
|
10173
|
+
status?:
|
|
10174
|
+
| "pending"
|
|
10175
|
+
| "in_progress"
|
|
10176
|
+
| "converted"
|
|
10177
|
+
| "failed"
|
|
10178
|
+
| "ready_to_convert"
|
|
10179
|
+
| "incomplete"
|
|
10180
|
+
| "merged";
|
|
10181
|
+
last_page: boolean;
|
|
10182
|
+
creator: AdminOrRep;
|
|
10183
|
+
editor?: AdminOrRep;
|
|
10184
|
+
createdAt: Date;
|
|
10185
|
+
updatedAt: Date;
|
|
10186
|
+
}
|
|
10187
|
+
export interface UpdateBody {
|
|
10188
|
+
disabled: boolean;
|
|
10189
|
+
cart_annotation?: CartAnnotation;
|
|
10190
|
+
client: StringId;
|
|
10191
|
+
cart?: Cart.Data;
|
|
10192
|
+
}
|
|
10193
|
+
|
|
10194
|
+
export namespace Find {
|
|
10195
|
+
export type Params = DefaultPaginationQueryParams & {
|
|
10196
|
+
_id?: StringId | StringId[];
|
|
10197
|
+
job?: StringId | StringId[];
|
|
10198
|
+
template?: StringId | StringId[];
|
|
10199
|
+
page_number?: number;
|
|
10200
|
+
proforma?: StringId | StringId[];
|
|
10201
|
+
status: string | string[];
|
|
10202
|
+
};
|
|
10203
|
+
export interface Result extends DefaultPaginationResult {
|
|
10204
|
+
data: Data[] | PopulatedDoc[];
|
|
10205
|
+
}
|
|
10206
|
+
}
|
|
10207
|
+
export namespace Get {
|
|
10208
|
+
export type ID = string;
|
|
10209
|
+
export type Result = Data | PopulatedDoc;
|
|
10210
|
+
}
|
|
10211
|
+
export namespace Update {
|
|
10212
|
+
export type ID = StringId;
|
|
10213
|
+
export type Body = UpdateBody;
|
|
10214
|
+
export type Result = Data;
|
|
10215
|
+
}
|
|
10216
|
+
}
|
|
10217
|
+
|
|
10218
|
+
export namespace ActivityAiSalesOrder {
|
|
10219
|
+
export interface Data {
|
|
10220
|
+
_id: string;
|
|
10221
|
+
creator: RepCreator;
|
|
10222
|
+
editor?: RepCreator;
|
|
10223
|
+
teams: StringId[];
|
|
10224
|
+
tags: StringId[];
|
|
10225
|
+
time: number;
|
|
10226
|
+
client?: StringId;
|
|
10227
|
+
client_name?: string;
|
|
10228
|
+
visit?: StringId;
|
|
10229
|
+
visit_id?: string;
|
|
10230
|
+
route?: string;
|
|
10231
|
+
sync_id: string;
|
|
10232
|
+
template_id: StringId;
|
|
10233
|
+
jo_group_id?: StringId;
|
|
10234
|
+
media: StringId[];
|
|
10235
|
+
geo_tag?: GeoTag;
|
|
10236
|
+
geoPoint?: GeoPoint;
|
|
10237
|
+
platform?: string;
|
|
10238
|
+
version_name?: string;
|
|
10239
|
+
battery_level?: number;
|
|
10240
|
+
device_brand?: string;
|
|
10241
|
+
device_os?: string;
|
|
10242
|
+
device_os_version?: string;
|
|
10243
|
+
device_model?: string;
|
|
10244
|
+
identifier?: number;
|
|
10245
|
+
device_id?: string;
|
|
10246
|
+
device_unique_id?: string;
|
|
10247
|
+
network_state?: number;
|
|
10248
|
+
time_zone?: string;
|
|
10249
|
+
job_start_time?: number;
|
|
10250
|
+
job_end_time?: number;
|
|
10251
|
+
job_duration?: number;
|
|
10252
|
+
company_namespace: string[];
|
|
10253
|
+
createdAt: Date;
|
|
10254
|
+
updatedAt: Date;
|
|
10255
|
+
}
|
|
10256
|
+
export interface PopulatedDoc {
|
|
10257
|
+
_id: string;
|
|
10258
|
+
creator: RepCreator;
|
|
10259
|
+
editor?: RepCreator;
|
|
10260
|
+
teams: StringId[];
|
|
10261
|
+
teams_populated: Pick<Team.TeamSchema, "name" | "_id">[];
|
|
10262
|
+
tags: StringId[];
|
|
10263
|
+
tags_populated: Pick<Tag.TagSchema, "tag" | "type" | "_id">[];
|
|
10264
|
+
time: number;
|
|
10265
|
+
client?: StringId;
|
|
10266
|
+
client_populated?: Pick<
|
|
10267
|
+
Client.ClientSchema,
|
|
10268
|
+
"name" | "client_code" | "_id"
|
|
10269
|
+
>;
|
|
10270
|
+
client_name?: string;
|
|
10271
|
+
visit?: string;
|
|
10272
|
+
visit_populated?: Visit.VisitSchema;
|
|
10273
|
+
visit_id?: string;
|
|
10274
|
+
route?: StringId;
|
|
10275
|
+
route_populated?: Pick<Route.RouteSchema, "name" | "_id">;
|
|
10276
|
+
sync_id: string;
|
|
10277
|
+
template_id: StringId;
|
|
10278
|
+
jo_group_id?: StringId;
|
|
10279
|
+
jo_group_id_populated?: Pick<
|
|
10280
|
+
OcrInvoiceJobGroup.Data,
|
|
10281
|
+
"name" | "status" | "_id"
|
|
10282
|
+
>;
|
|
10283
|
+
media: StringId[];
|
|
10284
|
+
media_populated: PopulatedMediaStorage[];
|
|
10285
|
+
geo_tag?: GeoTag;
|
|
10286
|
+
geoPoint?: GeoPoint;
|
|
10287
|
+
platform?: string;
|
|
10288
|
+
version_name?: string;
|
|
10289
|
+
battery_level?: number;
|
|
10290
|
+
device_brand?: string;
|
|
10291
|
+
device_os?: string;
|
|
10292
|
+
device_os_version?: string;
|
|
10293
|
+
device_model?: string;
|
|
10294
|
+
identifier?: number;
|
|
10295
|
+
device_id?: string;
|
|
10296
|
+
device_unique_id?: string;
|
|
10297
|
+
network_state?: number;
|
|
10298
|
+
time_zone?: string;
|
|
10299
|
+
job_start_time?: number;
|
|
10300
|
+
job_end_time?: number;
|
|
10301
|
+
job_duration?: number;
|
|
10302
|
+
company_namespace: string[];
|
|
10303
|
+
createdAt: Date;
|
|
10304
|
+
updatedAt: Date;
|
|
10305
|
+
}
|
|
10306
|
+
export interface CreateBody {
|
|
10307
|
+
creator: RepCreator;
|
|
10308
|
+
teams: StringId[];
|
|
10309
|
+
tags: StringId[];
|
|
10310
|
+
time: number;
|
|
10311
|
+
client?: StringId;
|
|
10312
|
+
client_name?: string;
|
|
10313
|
+
visit?: StringId;
|
|
10314
|
+
visit_id?: string;
|
|
10315
|
+
route?: string;
|
|
10316
|
+
sync_id: string;
|
|
10317
|
+
template_id: StringId;
|
|
10318
|
+
media: StringId[];
|
|
10319
|
+
geo_tag?: GeoTag;
|
|
10320
|
+
geoPoint?: GeoPoint;
|
|
10321
|
+
platform?: string;
|
|
10322
|
+
version_name?: string;
|
|
10323
|
+
battery_level?: number;
|
|
10324
|
+
device_brand?: string;
|
|
10325
|
+
device_os?: string;
|
|
10326
|
+
device_os_version?: string;
|
|
10327
|
+
device_model?: string;
|
|
10328
|
+
identifier?: number;
|
|
10329
|
+
device_id?: string;
|
|
10330
|
+
device_unique_id?: string;
|
|
10331
|
+
network_state?: number;
|
|
10332
|
+
time_zone?: string;
|
|
10333
|
+
job_start_time?: number;
|
|
10334
|
+
job_end_time?: number;
|
|
10335
|
+
job_duration?: number;
|
|
10336
|
+
company_namespace: string[];
|
|
10337
|
+
}
|
|
10338
|
+
export namespace Find {
|
|
10339
|
+
export type Params = DefaultPaginationQueryParams & {
|
|
10340
|
+
_id?: StringId | StringId[];
|
|
10341
|
+
job?: StringId | StringId[];
|
|
10342
|
+
template?: StringId | StringId[];
|
|
10343
|
+
page_number?: number;
|
|
10344
|
+
proforma?: StringId | StringId[];
|
|
10345
|
+
status: string | string[];
|
|
10346
|
+
};
|
|
10347
|
+
export interface Result extends DefaultPaginationResult {
|
|
10348
|
+
data: Data[] | PopulatedDoc[];
|
|
10349
|
+
}
|
|
10350
|
+
}
|
|
10351
|
+
export namespace Get {
|
|
10352
|
+
export type ID = string;
|
|
10353
|
+
export type Result = Data | PopulatedDoc;
|
|
10354
|
+
}
|
|
10355
|
+
|
|
10356
|
+
export namespace Create {
|
|
10357
|
+
export type Body = CreateBody;
|
|
10358
|
+
export type Result = Data;
|
|
10359
|
+
}
|
|
10360
|
+
}
|
|
9069
10361
|
}
|
|
9070
10362
|
|
|
9071
10363
|
export type StringId = string;
|