repzo 1.0.82 → 1.0.83

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.
@@ -7886,7 +7886,889 @@ export namespace Service {
7886
7886
  }
7887
7887
  }
7888
7888
  }
7889
+
7890
+ export namespace AssetPartType {
7891
+ export interface Data {
7892
+ _id: StringId;
7893
+ creator: AdminOrRep;
7894
+ editor?: AdminOrRep;
7895
+ name: string;
7896
+ color: string;
7897
+ local_name?: string;
7898
+ disabled: boolean;
7899
+ integration_meta?: { [key: string]: any };
7900
+ company_namespace: string[];
7901
+ createdAt: Date;
7902
+ updatedAt: Date;
7903
+ }
7904
+ export interface CreateBody {
7905
+ creator?: AdminOrRep;
7906
+ name: string;
7907
+ color: string;
7908
+ local_name?: string;
7909
+ disabled?: boolean;
7910
+ integration_meta?: { [key: string]: any };
7911
+ company_namespace?: string[];
7912
+ }
7913
+ export interface UpdateBody {
7914
+ _id?: StringId;
7915
+ creator?: AdminOrRep;
7916
+ editor?: AdminOrRep;
7917
+ name?: string;
7918
+ local_name?: string;
7919
+ color?: string;
7920
+ disabled?: boolean;
7921
+ integration_meta?: { [key: string]: any };
7922
+ company_namespace?: string[];
7923
+ createdAt?: Date;
7924
+ updatedAt?: Date;
7925
+ }
7926
+
7927
+ export namespace Find {
7928
+ export type Params = DefaultPaginationQueryParams & {
7929
+ _id?: StringId[] | StringId;
7930
+ search?: string;
7931
+ name?: string[] | string;
7932
+ color?: string[] | string;
7933
+ local_name?: string[] | string;
7934
+ disabled?: boolean;
7935
+ from_updatedAt?: number;
7936
+ to_updatedAt?: number;
7937
+ [key: string]: any; // integration_meta.
7938
+ };
7939
+ export interface Result extends DefaultPaginationResult {
7940
+ data: Data[];
7941
+ }
7942
+ }
7943
+
7944
+ export namespace Get {
7945
+ export type ID = string;
7946
+ export type Result = Data;
7947
+ }
7948
+
7949
+ export namespace Create {
7950
+ export type Body = CreateBody;
7951
+ export type Result = Data;
7952
+ }
7953
+
7954
+ export namespace Update {
7955
+ export type ID = string;
7956
+ export type Body = UpdateBody;
7957
+ export type Result = Data;
7958
+ }
7959
+
7960
+ export namespace Remove {
7961
+ export type ID = string;
7962
+ export type Result = Data;
7963
+ }
7964
+ }
7965
+
7966
+ export namespace AssetPart {
7967
+ export interface Data {
7968
+ _id: StringId;
7969
+ creator: AdminOrRep;
7970
+ editor?: AdminOrRep;
7971
+ name: string;
7972
+ local_name?: string;
7973
+ description?: string;
7974
+ barcode?: string;
7975
+ model?: string;
7976
+ manufacturer?: string;
7977
+ year?: string;
7978
+ asset_part_types: StringId[];
7979
+ assets?: StringId[];
7980
+ asset_units?: StringId[];
7981
+ customFields?: { [key: string]: string | number | boolean };
7982
+ disabled: boolean;
7983
+ integration_meta?: { [key: string]: any };
7984
+ media?: StringId[];
7985
+ cover_photo?: StringId;
7986
+ company_namespace: string[];
7987
+ createdAt: Date;
7988
+ updatedAt: Date;
7989
+ }
7990
+ export interface PopulatedDoc {
7991
+ _id: StringId;
7992
+ creator: AdminOrRep;
7993
+ editor?: AdminOrRep;
7994
+ name: string;
7995
+ local_name?: string;
7996
+ description?: string;
7997
+ barcode?: string;
7998
+ model?: string;
7999
+ manufacturer?: string;
8000
+ year?: string;
8001
+ asset_part_types:
8002
+ | StringId[]
8003
+ | Pick<AssetPartType.Data, "_id" | "color" | "name" | "local_name">[];
8004
+ assets?: StringId[]; // | Asset[];
8005
+ asset_units?: StringId[]; // | AssetUnit[];
8006
+ customFields?: { [key: string]: string | number | boolean };
8007
+ disabled: boolean;
8008
+ integration_meta?: { [key: string]: any };
8009
+ media?: StringId[]; // | Media[];
8010
+ cover_photo?: StringId; // | Media;
8011
+ company_namespace: string[];
8012
+ createdAt: Date;
8013
+ updatedAt: Date;
8014
+ }
8015
+ export interface CreateBody {
8016
+ name: string;
8017
+ asset_part_types: StringId[];
8018
+ creator?: AdminOrRep;
8019
+ local_name?: string;
8020
+ description?: string;
8021
+ barcode?: string;
8022
+ model?: string;
8023
+ manufacturer?: string;
8024
+ year?: string;
8025
+ assets?: StringId[];
8026
+ asset_units?: StringId[];
8027
+ customFields?: { [key: string]: string | number | boolean };
8028
+ media?: StringId[];
8029
+ cover_photo?: StringId;
8030
+ disabled?: boolean;
8031
+ integration_meta?: { [key: string]: any };
8032
+ company_namespace?: string[];
8033
+ }
8034
+ export interface UpdateBody {
8035
+ _id?: StringId;
8036
+ creator?: AdminOrRep;
8037
+ editor?: AdminOrRep;
8038
+ name?: string;
8039
+ local_name?: string;
8040
+ description?: string;
8041
+ barcode?: string;
8042
+ model?: string;
8043
+ manufacturer?: string;
8044
+ year?: string;
8045
+ asset_part_types?: StringId[];
8046
+ assets?: StringId[];
8047
+ asset_units?: StringId[];
8048
+ customFields?: { [key: string]: string | number | boolean };
8049
+ disabled?: boolean;
8050
+ integration_meta?: { [key: string]: any };
8051
+ media?: StringId[];
8052
+ cover_photo?: StringId;
8053
+ company_namespace?: string[];
8054
+ createdAt?: Date;
8055
+ updatedAt?: Date;
8056
+ }
8057
+
8058
+ export namespace Find {
8059
+ export type Params = DefaultPaginationQueryParams & {
8060
+ _id?: StringId[] | StringId;
8061
+ search?: string;
8062
+ name?: string[] | string;
8063
+ disabled?: boolean;
8064
+ from_updatedAt?: number;
8065
+ to_updatedAt?: number;
8066
+ asset_part_types?: string[] | string;
8067
+ assets?: string[] | string;
8068
+ asset_units?: string[] | string;
8069
+ [key: string]: any; // integration_meta.
8070
+ };
8071
+ export interface Result extends DefaultPaginationResult {
8072
+ data: Data[] | PopulatedDoc[];
8073
+ }
8074
+ }
8075
+ export namespace Get {
8076
+ export type ID = string;
8077
+ export type Result = Data | PopulatedDoc;
8078
+ }
8079
+ export namespace Create {
8080
+ export type Body = CreateBody;
8081
+ export type Result = Data;
8082
+ }
8083
+ export namespace Update {
8084
+ export type ID = string;
8085
+ export type Body = UpdateBody;
8086
+ export type Result = Data;
8087
+ }
8088
+ export namespace Remove {
8089
+ export type ID = string;
8090
+ export type Result = Data;
8091
+ }
8092
+ }
8093
+
8094
+ export namespace AssetPartUnit {
8095
+ export interface Data {
8096
+ _id: StringId;
8097
+ creator: AdminOrRep;
8098
+ editor?: AdminOrRep;
8099
+ directional_status:
8100
+ | "received"
8101
+ | "handed"
8102
+ | "picked"
8103
+ | "returned"
8104
+ | "stored";
8105
+ asset_part_receival: StringId;
8106
+ asset_part_index: number;
8107
+ splitted_from?: StringId;
8108
+ client: StringId;
8109
+ client_name: string;
8110
+ warehouse: StringId;
8111
+ warehouse_name: string;
8112
+ receival_warehouse: string;
8113
+ receival_warehouse_name: string;
8114
+ asset_part: StringId;
8115
+ asset_part_name: string;
8116
+ qty: number;
8117
+ custom_status?: StringId;
8118
+ receival_comment?: string;
8119
+ comment?: string;
8120
+ media?: StringId[];
8121
+ teams?: StringId[];
8122
+ integration_meta?: { [key: string]: any };
8123
+ company_namespace: string[];
8124
+ createdAt: Date;
8125
+ updatedAt: Date;
8126
+ }
8127
+ export interface PopulatedDoc {
8128
+ _id: StringId;
8129
+ creator: AdminOrRep;
8130
+ editor?: AdminOrRep;
8131
+ directional_status:
8132
+ | "received"
8133
+ | "handed"
8134
+ | "picked"
8135
+ | "returned"
8136
+ | "stored";
8137
+ asset_part_receival: StringId | AssetPartReceival.Data;
8138
+ asset_part_index: number;
8139
+ splitted_from?: StringId | Data;
8140
+ client:
8141
+ | StringId
8142
+ | Pick<Client.ClientSchema, "_id" | "name" | "client_code">;
8143
+ client_name: string;
8144
+ warehouse:
8145
+ | StringId
8146
+ | Pick<Warehouse.WarehouseSchema, "_id" | "code" | "type" | "name">;
8147
+ receival_warehouse:
8148
+ | string
8149
+ | Pick<Warehouse.WarehouseSchema, "_id" | "code" | "type" | "name">;
8150
+ asset_part: StringId | AssetPart.Data;
8151
+ asset_part_name: string;
8152
+ qty: number;
8153
+ custom_status?:
8154
+ | StringId
8155
+ | Pick<CustomStatus.CustomStatusSchema, "_id" | "name" | "local_name">;
8156
+ receival_comment?: string;
8157
+ comment?: string;
8158
+ media?: StringId[];
8159
+ teams?: StringId[] | Pick<Team.TeamSchema, "_id" | "name">[];
8160
+ integration_meta?: { [key: string]: any };
8161
+ company_namespace: string[];
8162
+ createdAt: Date;
8163
+ updatedAt: Date;
8164
+ }
8165
+ export interface CreateBody {
8166
+ creator?: AdminOrRep;
8167
+ directional_status:
8168
+ | "received"
8169
+ | "handed"
8170
+ | "picked"
8171
+ | "returned"
8172
+ | "stored";
8173
+ asset_part_receival: StringId;
8174
+ asset_part_index: number;
8175
+ splitted_from?: StringId;
8176
+ client: StringId;
8177
+ client_name: string;
8178
+ warehouse: StringId;
8179
+ receival_warehouse: string;
8180
+ asset_part: StringId;
8181
+ asset_part_name: string;
8182
+ qty: number;
8183
+ custom_status?: StringId;
8184
+ receival_comment?: string;
8185
+ comment?: string;
8186
+ media?: StringId[];
8187
+ teams?: StringId[];
8188
+ integration_meta?: { [key: string]: any };
8189
+ company_namespace?: string[];
8190
+ }
8191
+ export interface UpdateBody {
8192
+ custom_status?: StringId;
8193
+ comment?: string;
8194
+ media?: StringId[];
8195
+ editor?: AdminOrRep;
8196
+ }
8197
+
8198
+ export namespace Find {
8199
+ export type Params = DefaultPaginationQueryParams & {
8200
+ _id?: StringId[] | StringId;
8201
+ asset_part_receival?: StringId[] | StringId;
8202
+ client?: StringId[] | StringId;
8203
+ warehouse?: StringId[] | StringId;
8204
+ receival_warehouse?: StringId[] | StringId;
8205
+ asset_part?: StringId[] | StringId;
8206
+ from_qty?: number;
8207
+ to_qty?: number;
8208
+ qty?: number;
8209
+ custom_status?: StringId[] | StringId;
8210
+ teams?: StringId[] | StringId;
8211
+ from_updatedAt?: number;
8212
+ to_updatedAt?: number;
8213
+ from_createdAt?: number;
8214
+ to_createdAt?: number;
8215
+ [key: string]: any; // integration_meta.
8216
+ };
8217
+ export interface Result extends DefaultPaginationResult {
8218
+ data: Data[] | PopulatedDoc[];
8219
+ }
8220
+ }
8221
+ export namespace Get {
8222
+ export type ID = string;
8223
+ export type Result = Data | PopulatedDoc;
8224
+ }
8225
+ export namespace Update {
8226
+ export type ID = string;
8227
+ export type Body = UpdateBody;
8228
+ export type Result = Data;
8229
+ }
8230
+ }
8231
+
8232
+ export namespace AssetPartReceival {
8233
+ export interface Data {
8234
+ _id: StringId;
8235
+ creator: AdminOrRep;
8236
+ editor?: AdminOrRep;
8237
+ sync_id: string;
8238
+ transaction_processed: boolean;
8239
+ client: StringId;
8240
+ client_name: string;
8241
+ warehouse: StringId;
8242
+ warehouse_name: string;
8243
+ teams?: StringId[];
8244
+ time: number;
8245
+ business_day?: string;
8246
+ visit_id?: string;
8247
+ serial_number: SerialNumber;
8248
+ description?: string;
8249
+ custom_status?: StringId;
8250
+ signature?: StringId;
8251
+ media?: StringId[];
8252
+ asset_parts: {
8253
+ _id: StringId;
8254
+ asset_part: StringId;
8255
+ asset_part_name: string;
8256
+ qty: number;
8257
+ comment?: string;
8258
+ }[];
8259
+ asset_parts_count?: number;
8260
+ total_asset_parts_qty?: number;
8261
+ integration_meta?: { [key: string]: any };
8262
+ company_namespace: string[];
8263
+ createdAt: Date;
8264
+ updatedAt: Date;
8265
+ }
8266
+ export interface PopulatedDoc {
8267
+ _id: StringId;
8268
+ creator: AdminOrRep;
8269
+ editor?: AdminOrRep;
8270
+ sync_id: string;
8271
+ transaction_processed: boolean;
8272
+ client:
8273
+ | StringId
8274
+ | Pick<Client.ClientSchema, "_id" | "name" | "client_code">;
8275
+ client_name: string;
8276
+ warehouse:
8277
+ | StringId
8278
+ | Pick<Warehouse.WarehouseSchema, "_id" | "code" | "type" | "name">;
8279
+ warehouse_name: string;
8280
+ teams?: StringId[] | Pick<Team.TeamSchema, "_id" | "name">[];
8281
+ time: number;
8282
+ business_day?: string;
8283
+ visit_id?: string;
8284
+ serial_number: SerialNumber;
8285
+ description?: string;
8286
+ custom_status?:
8287
+ | StringId
8288
+ | Pick<CustomStatus.CustomStatusSchema, "_id" | "name" | "local_name">;
8289
+ signature?: StringId;
8290
+ media?: StringId[];
8291
+ asset_parts: {
8292
+ _id: StringId;
8293
+ asset_part: StringId | AssetPart.Data;
8294
+ asset_part_name: string;
8295
+ qty: number;
8296
+ comment?: string;
8297
+ }[];
8298
+ asset_parts_count?: number;
8299
+ total_asset_parts_qty?: number;
8300
+ integration_meta?: { [key: string]: any };
8301
+ company_namespace: string[];
8302
+ createdAt: Date;
8303
+ updatedAt: Date;
8304
+ }
8305
+ export interface CreateBody {
8306
+ creator?: AdminOrRep;
8307
+ editor?: AdminOrRep;
8308
+ sync_id: string;
8309
+ transaction_processed: false;
8310
+ serial_number?: SerialNumber;
8311
+ client: StringId;
8312
+ client_name: string;
8313
+ warehouse: StringId;
8314
+ warehouse_name: string;
8315
+ teams?: StringId[];
8316
+ time: number;
8317
+ business_day?: string;
8318
+ visit_id?: string;
8319
+ description?: string;
8320
+ custom_status?: StringId;
8321
+ signature?: StringId;
8322
+ media?: StringId[];
8323
+ asset_parts: {
8324
+ asset_part: StringId;
8325
+ asset_part_name: string;
8326
+ qty: number;
8327
+ comment?: string;
8328
+ }[];
8329
+ integration_meta?: { [key: string]: any };
8330
+ asset_parts_count?: number;
8331
+ total_asset_parts_qty?: number;
8332
+ company_namespace: string[];
8333
+ }
8334
+ export interface UpdateBody {
8335
+ description?: string;
8336
+ custom_status?: StringId;
8337
+ media?: StringId[];
8338
+ integration_meta?: { [key: string]: any };
8339
+ }
8340
+
8341
+ export namespace Find {
8342
+ export type Params = DefaultPaginationQueryParams & {
8343
+ _id?: StringId[] | StringId;
8344
+ search?: string; // serial_number.formatted
8345
+ serial_number?: string[] | string;
8346
+ "serial_number.formatted"?: string[] | string;
8347
+ sync_id?: string[] | string;
8348
+ client?: string[] | string;
8349
+ warehouse?: string[] | string;
8350
+ creator?: string | string[];
8351
+ "creator._id"?: string[] | string;
8352
+ creator_type?: string | string[];
8353
+ teams?: string[] | string;
8354
+ visit_id?: string[] | string;
8355
+ custom_status?: string[] | string;
8356
+ asset_part?: string[] | string;
8357
+ "asset_parts.asset_part"?: string[] | string;
8358
+ from_time?: number;
8359
+ to_time?: number;
8360
+ from_createdAt?: number;
8361
+ to_createdAt?: number;
8362
+ from_updatedAt?: number;
8363
+ to_updatedAt?: number;
8364
+ [key: string]: any; // integration_meta.
8365
+ };
8366
+ export interface Result extends DefaultPaginationResult {
8367
+ data: Data[] | PopulatedDoc[];
8368
+ }
8369
+ }
8370
+ export namespace Get {
8371
+ export type ID = string;
8372
+ export type Result = Data | PopulatedDoc;
8373
+ }
8374
+ export namespace Create {
8375
+ export type Body = CreateBody;
8376
+ export type Result = Data;
8377
+ }
8378
+ export namespace Update {
8379
+ export type ID = string;
8380
+ export type Body = UpdateBody;
8381
+ export type Result = Data;
8382
+ }
8383
+ export namespace Patch {
8384
+ export type Params = { updateStatus: true };
8385
+ export type Body = {
8386
+ readQuery: [{ key: "_id"; operator: "in"; value: StringId[] }];
8387
+ writeQuery: { key: "custom_status"; command: "set"; value: StringId };
8388
+ };
8389
+ export type Result = { nFound: number; nModified: number };
8390
+ }
8391
+ }
8392
+
8393
+ export namespace AssetPartTransfer {
8394
+ export interface Data {
8395
+ _id: StringId;
8396
+ creator: AdminOrRep;
8397
+ editor?: AdminOrRep;
8398
+ transaction_processed: boolean;
8399
+ serial_number: SerialNumber;
8400
+ type: "load" | "unload";
8401
+ from: StringId;
8402
+ to: StringId;
8403
+ from_name?: string;
8404
+ to_name?: string;
8405
+ time: number;
8406
+ status:
8407
+ | "pending"
8408
+ | "approved"
8409
+ | "processing"
8410
+ | "rejected"
8411
+ | "processed"
8412
+ | "failed";
8413
+ sync_id: string;
8414
+ asset_part_units: {
8415
+ asset_part_unit: StringId;
8416
+ qty: number;
8417
+ asset_part_name?: string;
8418
+ note?: string;
8419
+ splitted_from?: StringId;
8420
+ }[];
8421
+ teams?: StringId[];
8422
+ business_day?: string;
8423
+ asset_part_units_count?: number;
8424
+ total_asset_part_units_qty?: number;
8425
+ custom_status?: StringId;
8426
+ description?: string;
8427
+ process_time?: number;
8428
+ visit_id?: string;
8429
+ integration_meta?: { [key: string]: any };
8430
+ company_namespace: string[];
8431
+ createdAt: Date;
8432
+ updatedAt: Date;
8433
+ }
8434
+ export interface PopulatedDoc {
8435
+ _id: StringId;
8436
+ creator: AdminOrRep;
8437
+ editor?: AdminOrRep;
8438
+ transaction_processed: boolean;
8439
+ serial_number: SerialNumber;
8440
+ type: "load" | "unload";
8441
+ from:
8442
+ | StringId
8443
+ | Pick<Warehouse.WarehouseSchema, "_id" | "code" | "type" | "name">;
8444
+ to:
8445
+ | StringId
8446
+ | Pick<Warehouse.WarehouseSchema, "_id" | "code" | "type" | "name">;
8447
+ from_name?: string;
8448
+ to_name?: string;
8449
+ time: number;
8450
+ status:
8451
+ | "pending"
8452
+ | "approved"
8453
+ | "processing"
8454
+ | "rejected"
8455
+ | "processed"
8456
+ | "failed";
8457
+ sync_id: string;
8458
+ asset_part_units: {
8459
+ asset_part_unit: StringId | AssetPartUnit.Data;
8460
+ qty: number;
8461
+ asset_part_name?: string;
8462
+ note?: string;
8463
+ splitted_from?: StringId | AssetPartUnit.Data;
8464
+ }[];
8465
+ teams?: StringId[] | Pick<Team.TeamSchema, "_id" | "name">[];
8466
+ business_day?: string;
8467
+ asset_part_units_count?: number;
8468
+ total_asset_part_units_qty?: number;
8469
+ custom_status?:
8470
+ | StringId
8471
+ | Pick<CustomStatus.CustomStatusSchema, "_id" | "name" | "local_name">;
8472
+ description?: string;
8473
+ process_time?: number;
8474
+ visit_id?: string;
8475
+ integration_meta?: { [key: string]: any };
8476
+ company_namespace: string[];
8477
+ createdAt: Date;
8478
+ updatedAt: Date;
8479
+ }
8480
+ export interface CreateBody {
8481
+ creator?: AdminOrRep;
8482
+ serial_number: SerialNumber;
8483
+ type: "load" | "unload";
8484
+ from: StringId;
8485
+ to: StringId;
8486
+ from_name?: string;
8487
+ to_name?: string;
8488
+ time: number;
8489
+ transaction_processed?: false;
8490
+ status?: "pending";
8491
+ sync_id: string;
8492
+ asset_part_units: {
8493
+ asset_part_unit: StringId;
8494
+ qty: number;
8495
+ asset_part_name?: string;
8496
+ note?: string;
8497
+ }[];
8498
+ teams?: StringId[];
8499
+ business_day?: string;
8500
+ asset_part_units_count?: number;
8501
+ total_asset_part_units_qty?: number;
8502
+ custom_status?: StringId;
8503
+ description?: string;
8504
+ visit_id?: string;
8505
+ integration_meta?: { [key: string]: any };
8506
+ company_namespace: string[];
8507
+ }
8508
+ export interface UpdateBody {
8509
+ _id?: StringId;
8510
+ creator?: AdminOrRep;
8511
+ editor?: AdminOrRep;
8512
+ transaction_processed?: boolean;
8513
+ serial_number?: SerialNumber;
8514
+ type?: "load" | "unload";
8515
+ from?: StringId;
8516
+ to?: StringId;
8517
+ from_name?: string;
8518
+ to_name?: string;
8519
+ time?: number;
8520
+ status?:
8521
+ | "pending"
8522
+ | "approved"
8523
+ | "processing"
8524
+ | "rejected"
8525
+ | "processed"
8526
+ | "failed";
8527
+ sync_id?: string;
8528
+ asset_part_units?: {
8529
+ asset_part_unit: StringId;
8530
+ qty: number;
8531
+ asset_part_name?: string;
8532
+ note?: string;
8533
+ splitted_from?: StringId;
8534
+ }[];
8535
+ teams?: StringId[];
8536
+ business_day?: string;
8537
+ asset_part_units_count?: number;
8538
+ total_asset_part_units_qty?: number;
8539
+ custom_status?: StringId;
8540
+ description?: string;
8541
+ process_time?: number;
8542
+ visit_id?: string;
8543
+ integration_meta?: { [key: string]: any };
8544
+ company_namespace?: string[];
8545
+ createdAt?: Date;
8546
+ updatedAt?: Date;
8547
+ }
8548
+
8549
+ export namespace Find {
8550
+ export type Params = DefaultPaginationQueryParams & {
8551
+ nodeCycles?: StringId[] | StringId;
8552
+ _id?: StringId[] | StringId;
8553
+ search?: string; // serial_number.formatted
8554
+ "serial_number.formatted"?: string[] | string;
8555
+ sync_id?: string[] | string;
8556
+ "creator._id"?: string[] | string;
8557
+ type?: string[] | string;
8558
+ from?: string[] | string;
8559
+ to?: string[] | string;
8560
+ teams?: string[] | string;
8561
+ visit_id?: string[] | string;
8562
+ custom_status?: string[] | string;
8563
+ transaction_processed?: boolean;
8564
+ "asset_part_units.asset_part_unit"?: string[] | string;
8565
+ from_time?: number;
8566
+ to_time?: number;
8567
+ from_createdAt?: number;
8568
+ to_createdAt?: number;
8569
+ from_updatedAt?: number;
8570
+ to_updatedAt?: number;
8571
+ [key: string]: any; // integration_meta.
8572
+ };
8573
+ export interface Result extends DefaultPaginationResult {
8574
+ data: Data[] | PopulatedDoc[];
8575
+ }
8576
+ }
8577
+ export namespace Get {
8578
+ export type ID = StringId;
8579
+ export type Result = Data | PopulatedDoc;
8580
+ }
8581
+ export namespace Create {
8582
+ export type Body = CreateBody;
8583
+ export type Result = Data;
8584
+ }
8585
+ export namespace Update {
8586
+ export type ID = StringId;
8587
+ export type Body = UpdateBody;
8588
+ export type Result = Data;
8589
+ }
8590
+ export namespace Patch {
8591
+ export type Params = { updateStatus: true };
8592
+ export type Body = {
8593
+ readQuery: [{ key: "_id"; operator: "in"; value: StringId[] }];
8594
+ writeQuery: { key: "custom_status"; command: "set"; value: StringId };
8595
+ };
8596
+ export type Result = { nFound: number; nModified: number };
8597
+ }
8598
+ }
8599
+
8600
+ export namespace ReturnStoreAssetPartUnit {
8601
+ export interface Data {
8602
+ _id: StringId;
8603
+ creator: AdminOrRep;
8604
+ editor?: AdminOrRep;
8605
+ sync_id: string;
8606
+ transaction_processed: boolean;
8607
+ type: "returned" | "stored";
8608
+ client: StringId;
8609
+ client_name: string;
8610
+ warehouse: StringId;
8611
+ warehouse_name: string;
8612
+ teams?: StringId[];
8613
+ time: number;
8614
+ business_day?: string;
8615
+ visit_id?: string;
8616
+ serial_number: SerialNumber;
8617
+ description?: string;
8618
+ custom_status?: StringId;
8619
+ signature?: StringId;
8620
+ media?: StringId[];
8621
+ asset_part_units: {
8622
+ _id: StringId;
8623
+ asset_part_unit: StringId;
8624
+ qty: number;
8625
+ asset_part?: StringId;
8626
+ asset_part_name?: string;
8627
+ comment?: string;
8628
+ splitted_from?: StringId;
8629
+ }[];
8630
+ asset_part_units_count?: number;
8631
+ total_asset_part_units_qty?: number;
8632
+ integration_meta?: { [key: string]: any };
8633
+ company_namespace: string[];
8634
+ createdAt: Date;
8635
+ updatedAt: Date;
8636
+ }
8637
+ export interface PopulatedDoc {
8638
+ _id: StringId;
8639
+ creator: AdminOrRep;
8640
+ editor?: AdminOrRep;
8641
+ sync_id: string;
8642
+ transaction_processed: boolean;
8643
+ type: "returned" | "stored";
8644
+ client:
8645
+ | StringId
8646
+ | Pick<Client.ClientSchema, "_id" | "name" | "client_code">;
8647
+ client_name: string;
8648
+ warehouse:
8649
+ | StringId
8650
+ | Pick<Warehouse.WarehouseSchema, "_id" | "code" | "type" | "name">;
8651
+ warehouse_name: string;
8652
+ teams?: StringId[] | Pick<Team.TeamSchema, "_id" | "name">[];
8653
+ time: number;
8654
+ business_day?: string;
8655
+ visit_id?: string;
8656
+ serial_number: SerialNumber;
8657
+ description?: string;
8658
+ custom_status?:
8659
+ | StringId
8660
+ | Pick<CustomStatus.CustomStatusSchema, "_id" | "name" | "local_name">;
8661
+ signature?: StringId;
8662
+ media?: StringId[];
8663
+ asset_part_units: {
8664
+ _id: StringId;
8665
+ asset_part_unit: StringId | AssetPartUnit.Data;
8666
+ qty: number;
8667
+ asset_part?: StringId | AssetPart.Data;
8668
+ asset_part_name?: string;
8669
+ comment?: string;
8670
+ }[];
8671
+ asset_part_units_count?: number;
8672
+ total_asset_part_units_qty?: number;
8673
+ integration_meta?: { [key: string]: any };
8674
+ company_namespace: string[];
8675
+ createdAt: Date;
8676
+ updatedAt: Date;
8677
+ }
8678
+ export interface CreateBody {
8679
+ creator?: AdminOrRep;
8680
+ editor?: AdminOrRep;
8681
+ type: "returned" | "stored";
8682
+ sync_id: string;
8683
+ transaction_processed: false;
8684
+ serial_number?: SerialNumber;
8685
+ client: StringId;
8686
+ client_name: string;
8687
+ warehouse: StringId;
8688
+ warehouse_name: string;
8689
+ teams?: StringId[];
8690
+ time: number;
8691
+ business_day?: string;
8692
+ visit_id?: string;
8693
+ description?: string;
8694
+ custom_status?: StringId;
8695
+ signature?: StringId;
8696
+ media?: StringId[];
8697
+ asset_part_units: {
8698
+ asset_part_unit: StringId;
8699
+ qty: number;
8700
+ asset_part?: StringId;
8701
+ asset_part_name?: string;
8702
+ comment?: string;
8703
+ }[];
8704
+ integration_meta?: { [key: string]: any };
8705
+ asset_part_units_count?: number;
8706
+ total_asset_part_units_qty?: number;
8707
+ company_namespace: string[];
8708
+ }
8709
+ export interface UpdateBody {
8710
+ description?: string;
8711
+ custom_status?: StringId;
8712
+ media?: StringId[];
8713
+ integration_meta?: { [key: string]: any };
8714
+ }
8715
+
8716
+ export namespace Find {
8717
+ export type Params = DefaultPaginationQueryParams & {
8718
+ _id?: StringId[] | StringId;
8719
+ search?: string; // serial_number.formatted
8720
+ "serial_number.formatted"?: string[] | string;
8721
+ sync_id?: string[] | string;
8722
+ client?: string[] | string;
8723
+ warehouse?: string[] | string;
8724
+ "creator._id"?: string[] | string;
8725
+ teams?: string[] | string;
8726
+ visit_id?: string[] | string;
8727
+ custom_status?: string[] | string;
8728
+ "asset_parts.asset_part"?: string[] | string;
8729
+ "asset_parts.asset_part_unit"?: string[] | string;
8730
+ from_time?: number;
8731
+ to_time?: number;
8732
+ from_createdAt?: number;
8733
+ to_createdAt?: number;
8734
+ from_updatedAt?: number;
8735
+ to_updatedAt?: number;
8736
+ [key: string]: any; // integration_meta.
8737
+ };
8738
+ export interface Result extends DefaultPaginationResult {
8739
+ data: Data[] | PopulatedDoc[];
8740
+ }
8741
+ }
8742
+ export namespace Get {
8743
+ export type ID = string;
8744
+ export type Result = Data | PopulatedDoc;
8745
+ }
8746
+ export namespace Create {
8747
+ export type Body = CreateBody;
8748
+ export type Result = Data;
8749
+ }
8750
+ export namespace Update {
8751
+ export type ID = string;
8752
+ export type Body = UpdateBody;
8753
+ export type Result = Data;
8754
+ }
8755
+ export namespace Patch {
8756
+ export type Params = { updateStatus: true };
8757
+ export type Body = {
8758
+ readQuery: [{ key: "_id"; operator: "in"; value: StringId[] }];
8759
+ writeQuery: { key: "custom_status"; command: "set"; value: StringId };
8760
+ };
8761
+ export type Result = { nFound: number; nModified: number };
8762
+ }
8763
+ }
7889
8764
  }
7890
8765
 
7891
8766
  export type StringId = string;
7892
8767
  export type NameSpaces = string[];
8768
+ export interface AdminOrRep {
8769
+ _id: StringId;
8770
+ name?: string;
8771
+ type: "admin" | "rep";
8772
+ admin?: StringId;
8773
+ rep?: StringId;
8774
+ }