repzo 1.0.247 → 1.0.248

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.
@@ -5554,9 +5554,7 @@ export namespace Service {
5554
5554
  score?: number;
5555
5555
  is_completed?: boolean;
5556
5556
  forms_v2?: {
5557
- form_id:
5558
- | StringId
5559
- | { _id: StringId; name: string; local_name?: string }; // Pick<FormV2.Data, "_id"|"name"|"local_name">
5557
+ form_id: StringId | Pick<FormV2.Data, "_id" | "name" | "local_name">;
5560
5558
  form_activity_id?: StringId;
5561
5559
  completion_required_for_dunning?: boolean;
5562
5560
  score_required_for_dunning?: boolean;
@@ -15109,353 +15107,65 @@ export namespace Service {
15109
15107
  }
15110
15108
  }
15111
15109
 
15112
- export namespace FormV2 {
15113
- export interface Visibility {
15114
- operator: "and" | "or";
15115
- conditions: {
15116
- division_id: string;
15117
- field_id: string;
15118
- type: "Boolean" | "List" | "YesNo"; // FieldType;
15119
- custom_list?: string | CustomList.Data;
15120
- operator: "lte" | "lt" | "gte" | "gt" | "eq" | "ne" | "in" | "nin";
15121
- value: any[];
15122
- }[];
15123
- }
15124
-
15125
- export const fieldType_enums = [
15126
- "Text", // Long Text
15127
- "String", // Short Text
15128
- "Phone", // phone
15129
- "Email", // email
15130
- "Date", // Date
15131
- // "Boolean", // No need any more in this form
15132
- "Number", // Number
15133
- "List", // List => custom List with ref or template (Allow multi, not only for media)
15134
- "Separator", // Separator
15135
- "Heading", // Heading
15136
- "Media", // Media + phone + Image
15137
- "Signature", // signature
15138
- "DateTime", // timestamp
15139
- "YesNo", // Yes/No/NA (with disable N/A option )
15140
- "ProductBarcodeScan", // String
15141
- "BarcodeScan", // String
15142
- "GeoPoint", // { coordinates: [0, 0], type: "Point" }
15143
- ] as const;
15144
-
15145
- export type FormV2FieldType = (typeof fieldType_enums)[number];
15146
- interface FieldPrintSettings {
15147
- three_inch: {
15148
- grid_column?: 1 | 2;
15149
- alignment?: "right" | "left" | "center";
15150
- border_width?: number;
15151
- label_font_size?: number;
15152
- value_font_size?: number;
15153
- media_height?: number | string;
15154
- media_width?: number | string;
15155
- align_media?: "right" | "left" | "center";
15156
- label_value_spacing?: number;
15157
- is_hidden?: boolean;
15158
- };
15159
- }
15160
- interface UsedField {
15161
- code: string;
15162
- key: string;
15163
- data_type: AvailableField.Data["data_type"];
15164
- field_type:
15165
- | "template_field"
15166
- // | "calculated_field"
15167
- | "source_attribute"
15168
- | "activity_attribute";
15169
- label: string;
15170
- isArray?: boolean;
15171
- formula_key: string;
15172
- field_id?: string;
15173
- example_value: AvailableField.Data["data_type"];
15174
- manipulator_function?: string;
15175
- lookup?: {
15176
- from?: string;
15177
- localField?: string;
15178
- foreignField?: string;
15179
- as?: string;
15180
- select?: string;
15181
- unwind?: boolean;
15182
- filter?: {
15183
- input?: string;
15184
- as: string;
15185
- cond: any;
15186
- };
15187
- };
15188
- }
15189
- export interface Field {
15190
- _id?: string;
15191
- name: string;
15192
- local_name?: string;
15193
- description?: string;
15194
- local_description?: string;
15195
- type: FormV2FieldType;
15196
- isArray?: boolean;
15197
- isRequired?: boolean;
15198
- disabled?: boolean;
15199
- formula_key?: string;
15200
- scoring_enabled?: boolean;
15201
- required_for_completion?: boolean;
15202
- visibility?: Visibility;
15203
- default_value?: any[];
15204
- custom_list?: string | CustomList.Data;
15205
- is_na_allowed?: boolean;
15206
- score_accumulator_type?: "max" | "sum";
15207
- yes_score?: number;
15208
- no_score?: number;
15209
- na_score?: number;
15210
- exist_score?: number;
15211
- media?: (string | MediaDoc)[];
15212
- invisible: boolean;
15213
- parent_field?: string;
15214
- custom_list_element?: string;
15215
- force_live_photo?: boolean;
15216
- min?: number;
15217
- max?: number;
15218
- is_integer?: boolean;
15219
- styles?: "check_list" | "toggle_yes_no_na" | "toggle_yes_no" | "buttons";
15220
- field_print_settings?: FieldPrintSettings;
15221
- is_calculated_field?: boolean;
15222
- formula?: string;
15223
- used_fields?: UsedField[];
15224
- }
15110
+ export namespace ActivityItemStatus {
15111
+ export type ItemStatus =
15112
+ | "current_user"
15113
+ | "non_user"
15114
+ | "generic_user"
15115
+ | "competitor_user"
15116
+ | "other";
15225
15117
 
15226
- interface Division {
15227
- _id: string;
15228
- name: string;
15229
- local_name?: string;
15230
- description?: string;
15231
- local_description?: string;
15232
- disabled?: boolean;
15233
- min_questions_to_answer_for_completion?: number;
15234
- min_score_for_completion?: number;
15235
- visibility?: Visibility;
15236
- fields: Field[];
15237
- }
15238
- interface PrintSettings {
15239
- three_inch: {
15240
- grid_columns?: 1 | 2;
15241
- logo_height?: number | string;
15242
- logo_width?: number | string;
15243
- align_logo?: "right" | "left" | "center";
15244
- space_y?: number;
15245
- };
15246
- A_four: {
15247
- banner_media?: string;
15248
- banner_height: number;
15249
- banner_width: number;
15250
- align_banner: "right" | "left" | "center";
15251
- header_label_font_size: number;
15252
- header_value_font_size: number;
15253
- align_header: "right" | "left" | "center";
15254
- division_name_font_size: number;
15255
- align_division: "right" | "left" | "center";
15256
- grid_columns: 1 | 2 | 3 | 4;
15257
- space_y: number;
15258
- field_label_size: number;
15259
- field_value_size: number;
15260
- footer_media?: string;
15261
- align_footer_media: "right" | "left" | "center";
15262
- footer_media_height: number;
15263
- footer_media_width: number;
15264
- footer_details: string;
15265
- align_footer_details: "right" | "left" | "center";
15266
- compressed_media_size:
15267
- | "original"
15268
- | "small"
15269
- | "medium"
15270
- | "large"
15271
- | "extra";
15272
- view_custom_list_element: boolean;
15273
- };
15118
+ export interface Item {
15119
+ product: string;
15120
+ product_name: string;
15121
+ status: ItemStatus;
15122
+ item_status_type?: string;
15123
+ feedback?: string;
15124
+ note?: string;
15125
+ feedback_current_user?: number;
15126
+ previous_status?: ItemStatus;
15127
+ previous_status_id?: string;
15128
+ previous_user?: string;
15129
+ previous_user_name?: string;
15130
+ previous_time?: number;
15274
15131
  }
15275
15132
 
15276
15133
  export interface Data {
15277
15134
  _id: string;
15278
- disabled: boolean;
15279
- name: string;
15280
- local_name?: string;
15281
- description?: string;
15282
- local_description?: string;
15283
- copied_from?: string;
15284
- scoring_enabled?: boolean;
15285
- completion_rules_enabled?: boolean;
15286
- min_questions_to_answer_for_completion?: number;
15287
- min_score_for_completion?: number;
15288
- divisions: Division[];
15135
+ items: Item[];
15136
+ geoPoint: GeoPoint;
15137
+ time: number;
15138
+ tags?: string[];
15139
+ visit_id: string;
15140
+ user: string;
15141
+ client: string;
15142
+ visit?: string;
15143
+ client_name: string;
15144
+ user_name: string;
15145
+ sync_id: string;
15146
+ route?: string;
15147
+ platform?: string;
15148
+ version_name?: string;
15149
+ battery_level?: number;
15150
+ device_brand?: string;
15151
+ device_os?: string;
15152
+ device_os_version?: string;
15153
+ device_model?: string;
15154
+ time_zone?: string;
15155
+ identifier?: number;
15156
+ device_id?: string;
15157
+ device_unique_id?: string;
15158
+ teams?: string[];
15159
+ reviewed_by: ActivityReview[];
15160
+ network_state?: number;
15161
+ admin_notes: ActivityAdminNote[];
15162
+ comments: ActivityComment[];
15289
15163
  company_namespace: string[];
15290
- print_settings?: PrintSettings;
15291
- createdAt: Date;
15292
- updatedAt: Date;
15293
- }
15294
- }
15295
-
15296
- export namespace ActivityFormV2Result {
15297
- export const fieldType_enums = [
15298
- "Text", // Long Text
15299
- "String", // Short Text
15300
- "Phone", // phone
15301
- "Email", // email
15302
- "Date", // Date
15303
- // "Boolean", // No need any more in this form
15304
- "Number", // Number
15305
- "List", // List => custom List with ref or template (Allow multi, not only for media)
15306
- "Separator", // Separator
15307
- "Heading", // Heading
15308
- "Media", // Media + phone + Image
15309
- "Signature", // signature
15310
- "DateTime", // timestamp
15311
- "YesNo", // Yes/No/NA (with disable N/A option )
15312
- "ProductBarcodeScan", // String
15313
- "BarcodeScan", // String
15314
- "GeoPoint", // { coordinates: [0, 0], type: "Point" }
15315
- ] as const;
15316
- export type FormV2FieldType = (typeof fieldType_enums)[number];
15317
-
15318
- export interface FieldResult {
15319
- _id?: string;
15320
- field_id: string;
15321
- name: string;
15322
- type: FormV2FieldType;
15323
- isArray?: boolean;
15324
- isRequired?: boolean;
15325
- custom_list?: string;
15326
- formula_key?: string;
15327
- is_calculated_field?: boolean;
15328
- calculation_status?: "success" | "failed";
15329
- calculation_error?: any[];
15330
- score?: number;
15331
- is_completed?: boolean;
15332
- result:
15333
- | string[]
15334
- | number[]
15335
- | ["yes"]
15336
- | ["no"]
15337
- | ["na"]
15338
- | []
15339
- | { coordinates: [number, number]; type: "Point" }[]
15340
- | {
15341
- _id: string;
15342
- value: string | number;
15343
- type: "Number" | "String";
15344
- score?: number;
15345
- }[];
15346
- }
15347
-
15348
- export interface DivisionResult {
15349
- _id: string;
15350
- division_id: string;
15351
- name: string;
15352
- score?: number;
15353
- is_completed?: boolean;
15354
- fields: FieldResult[];
15355
- }
15356
-
15357
- export interface Data {
15358
- _id: string;
15359
- creator: AdminOrRepOrTenantOrClient;
15360
- editor?: AdminOrRepOrTenantOrClient;
15361
- serial_number: SerialNumber;
15362
- teams: string[];
15363
- tags: string[];
15364
- time: number;
15365
- client?: string;
15366
- client_name?: string;
15367
- visit?: string;
15368
- visit_id?: string;
15369
- route?: string;
15370
- workorder?: string;
15371
- sync_id: string;
15372
- // mobile data
15373
- geo_tag?: GeoTag;
15374
- geoPoint?: GeoPoint;
15375
- platform?: string;
15376
- version_name?: string;
15377
- battery_level?: number;
15378
- device_brand?: string;
15379
- device_os?: string;
15380
- device_os_version?: string;
15381
- device_model?: string;
15382
- identifier?: number;
15383
- device_id?: string;
15384
- device_unique_id?: string;
15385
- network_state?: number;
15386
- time_zone?: string;
15387
- job_start_time?: number;
15388
- job_end_time?: number;
15389
- job_duration?: number;
15390
- form_id: string;
15391
- results: DivisionResult[];
15392
- score?: number;
15393
- is_completed: boolean;
15394
- company_namespace: string[];
15395
- createdAt: Date;
15396
- updatedAt: Date;
15397
- }
15398
- }
15399
-
15400
- export namespace ActivityItemStatus {
15401
- export type ItemStatus =
15402
- | "current_user"
15403
- | "non_user"
15404
- | "generic_user"
15405
- | "competitor_user"
15406
- | "other";
15407
-
15408
- export interface Item {
15409
- product: string;
15410
- product_name: string;
15411
- status: ItemStatus;
15412
- item_status_type?: string;
15413
- feedback?: string;
15414
- note?: string;
15415
- feedback_current_user?: number;
15416
- previous_status?: ItemStatus;
15417
- previous_status_id?: string;
15418
- previous_user?: string;
15419
- previous_user_name?: string;
15420
- previous_time?: number;
15421
- }
15422
-
15423
- export interface Data {
15424
- _id: string;
15425
- items: Item[];
15426
- geoPoint: GeoPoint;
15427
- time: number;
15428
- tags?: string[];
15429
- visit_id: string;
15430
- user: string;
15431
- client: string;
15432
- visit?: string;
15433
- client_name: string;
15434
- user_name: string;
15435
- sync_id: string;
15436
- route?: string;
15437
- platform?: string;
15438
- version_name?: string;
15439
- battery_level?: number;
15440
- device_brand?: string;
15441
- device_os?: string;
15442
- device_os_version?: string;
15443
- device_model?: string;
15444
- time_zone?: string;
15445
- identifier?: number;
15446
- device_id?: string;
15447
- device_unique_id?: string;
15448
- teams?: string[];
15449
- reviewed_by: ActivityReview[];
15450
- network_state?: number;
15451
- admin_notes: ActivityAdminNote[];
15452
- comments: ActivityComment[];
15453
- company_namespace: string[];
15454
- job_start_time?: number;
15455
- job_end_time?: number;
15456
- job_duration?: number;
15457
- createdAt: string;
15458
- updatedAt: string;
15164
+ job_start_time?: number;
15165
+ job_end_time?: number;
15166
+ job_duration?: number;
15167
+ createdAt: string;
15168
+ updatedAt: string;
15459
15169
  }
15460
15170
  }
15461
15171
 
@@ -19804,6 +19514,466 @@ export namespace Service {
19804
19514
  export type Result = Data;
19805
19515
  }
19806
19516
  }
19517
+
19518
+ export namespace FormV2 {
19519
+ export interface Visibility {
19520
+ operator: "and" | "or";
19521
+ conditions: {
19522
+ division_id: string;
19523
+ field_id: string;
19524
+ type: "Boolean" | "List" | "YesNo"; // FieldType;
19525
+ custom_list?: string | CustomList.Data;
19526
+ operator: "lte" | "lt" | "gte" | "gt" | "eq" | "ne" | "in" | "nin";
19527
+ value: any[];
19528
+ }[];
19529
+ }
19530
+
19531
+ export const fieldType_enums = [
19532
+ "Text", // Long Text
19533
+ "String", // Short Text
19534
+ "Phone", // phone
19535
+ "Email", // email
19536
+ "Date", // Date
19537
+ // "Boolean", // No need any more in this form
19538
+ "Number", // Number
19539
+ "List", // List => custom List with ref or template (Allow multi, not only for media)
19540
+ "Separator", // Separator
19541
+ "Heading", // Heading
19542
+ "Media", // Media + phone + Image
19543
+ "Signature", // signature
19544
+ "DateTime", // timestamp
19545
+ "YesNo", // Yes/No/NA (with disable N/A option )
19546
+ "ProductBarcodeScan", // String
19547
+ "BarcodeScan", // String
19548
+ "GeoPoint", // { coordinates: [0, 0], type: "Point" }
19549
+ ] as const;
19550
+
19551
+ export type FormV2FieldType = (typeof fieldType_enums)[number];
19552
+ interface FieldPrintSettings {
19553
+ three_inch: {
19554
+ grid_column?: 1 | 2;
19555
+ alignment?: "right" | "left" | "center";
19556
+ border_width?: number;
19557
+ label_font_size?: number;
19558
+ value_font_size?: number;
19559
+ media_height?: number | string;
19560
+ media_width?: number | string;
19561
+ align_media?: "right" | "left" | "center";
19562
+ label_value_spacing?: number;
19563
+ is_hidden?: boolean;
19564
+ };
19565
+ }
19566
+ interface UsedField {
19567
+ code: string;
19568
+ key: string;
19569
+ data_type: AvailableField.Data["data_type"];
19570
+ field_type:
19571
+ | "template_field"
19572
+ // | "calculated_field"
19573
+ | "source_attribute"
19574
+ | "activity_attribute";
19575
+ label: string;
19576
+ isArray?: boolean;
19577
+ formula_key: string;
19578
+ field_id?: string;
19579
+ example_value: AvailableField.Data["data_type"];
19580
+ manipulator_function?: string;
19581
+ lookup?: {
19582
+ from?: string;
19583
+ localField?: string;
19584
+ foreignField?: string;
19585
+ as?: string;
19586
+ select?: string;
19587
+ unwind?: boolean;
19588
+ filter?: {
19589
+ input?: string;
19590
+ as: string;
19591
+ cond: any;
19592
+ };
19593
+ };
19594
+ }
19595
+ export interface Field {
19596
+ _id?: string;
19597
+ name: string;
19598
+ local_name?: string;
19599
+ description?: string;
19600
+ local_description?: string;
19601
+ type: FormV2FieldType;
19602
+ isArray?: boolean;
19603
+ isRequired?: boolean;
19604
+ disabled?: boolean;
19605
+ formula_key?: string;
19606
+ scoring_enabled?: boolean;
19607
+ required_for_completion?: boolean;
19608
+ visibility?: Visibility;
19609
+ default_value?: any[];
19610
+ custom_list?: string | CustomList.Data;
19611
+ is_na_allowed?: boolean;
19612
+ score_accumulator_type?: "max" | "sum";
19613
+ yes_score?: number;
19614
+ no_score?: number;
19615
+ na_score?: number;
19616
+ exist_score?: number;
19617
+ media?: (string | MediaDoc)[];
19618
+ invisible: boolean;
19619
+ parent_field?: string;
19620
+ custom_list_element?: string;
19621
+ force_live_photo?: boolean;
19622
+ min?: number;
19623
+ max?: number;
19624
+ is_integer?: boolean;
19625
+ styles?: "check_list" | "toggle_yes_no_na" | "toggle_yes_no" | "buttons";
19626
+ field_print_settings?: FieldPrintSettings;
19627
+ is_calculated_field?: boolean;
19628
+ formula?: string;
19629
+ used_fields?: UsedField[];
19630
+ }
19631
+
19632
+ interface Division {
19633
+ _id: string;
19634
+ name: string;
19635
+ local_name?: string;
19636
+ description?: string;
19637
+ local_description?: string;
19638
+ disabled?: boolean;
19639
+ min_questions_to_answer_for_completion?: number;
19640
+ min_score_for_completion?: number;
19641
+ visibility?: Visibility;
19642
+ fields: Field[];
19643
+ }
19644
+ interface PrintSettings {
19645
+ three_inch: {
19646
+ grid_columns?: 1 | 2;
19647
+ logo_height?: number | string;
19648
+ logo_width?: number | string;
19649
+ align_logo?: "right" | "left" | "center";
19650
+ space_y?: number;
19651
+ };
19652
+ A_four: {
19653
+ banner_media?: string | MediaDoc;
19654
+ banner_height: number;
19655
+ banner_width: number;
19656
+ align_banner: "right" | "left" | "center";
19657
+ header_label_font_size: number;
19658
+ header_value_font_size: number;
19659
+ align_header: "right" | "left" | "center";
19660
+ division_name_font_size: number;
19661
+ align_division: "right" | "left" | "center";
19662
+ grid_columns: 1 | 2 | 3 | 4;
19663
+ space_y: number;
19664
+ field_label_size: number;
19665
+ field_value_size: number;
19666
+ footer_media?: string | MediaDoc;
19667
+ align_footer_media: "right" | "left" | "center";
19668
+ footer_media_height: number;
19669
+ footer_media_width: number;
19670
+ footer_details: string;
19671
+ align_footer_details: "right" | "left" | "center";
19672
+ compressed_media_size:
19673
+ | "original"
19674
+ | "small"
19675
+ | "medium"
19676
+ | "large"
19677
+ | "extra";
19678
+ view_custom_list_element: boolean;
19679
+ };
19680
+ }
19681
+ export interface Data {
19682
+ _id: string;
19683
+ disabled: boolean;
19684
+ name: string;
19685
+ local_name?: string;
19686
+ description?: string;
19687
+ local_description?: string;
19688
+ copied_from?: string;
19689
+ scoring_enabled?: boolean;
19690
+ completion_rules_enabled?: boolean;
19691
+ min_questions_to_answer_for_completion?: number;
19692
+ min_score_for_completion?: number;
19693
+ divisions: Division[];
19694
+ company_namespace: string[];
19695
+ print_settings?: PrintSettings;
19696
+ createdAt: Date;
19697
+ updatedAt: Date;
19698
+ }
19699
+
19700
+ export interface CreateBody {
19701
+ disabled?: boolean;
19702
+ name: string;
19703
+ local_name?: string;
19704
+ description?: string;
19705
+ local_description?: string;
19706
+ copied_from?: string;
19707
+ scoring_enabled?: boolean;
19708
+ completion_rules_enabled?: boolean;
19709
+ min_questions_to_answer_for_completion?: number;
19710
+ min_score_for_completion?: number;
19711
+ divisions: Division[];
19712
+ company_namespace?: string[];
19713
+ print_settings?: PrintSettings;
19714
+ }
19715
+ export type UpdateBody = Partial<Data>;
19716
+
19717
+ export type PopulatedDoc = Data & {
19718
+ presentation_populated?: CLMPresentation.Data;
19719
+ sequence_populated?: Pick<
19720
+ CLMSequence.Data,
19721
+ "position" | "_id" | "product" | "presentation"
19722
+ >[];
19723
+ photo_media_populated?: PopulatedMediaStorage & {
19724
+ ContentLength?: number;
19725
+ };
19726
+ };
19727
+
19728
+ type PopulatedKeys =
19729
+ | "custom_list"
19730
+ | "media"
19731
+ | "banner_media"
19732
+ | "footer_media";
19733
+ type SortingKeys = "_id" | "position" | "updatedAt";
19734
+
19735
+ export namespace Find {
19736
+ export type Params = DefaultPaginationQueryParams & {
19737
+ sortBy?: { field: SortingKeys; type: "asc" | "desc" }[];
19738
+ populatedKeys?: PopulatedKeys | PopulatedKeys[];
19739
+ _id?: StringId | StringId[];
19740
+ search?: string;
19741
+ name?: string;
19742
+ scoring_enabled?: boolean | boolean[];
19743
+ completion_rules_enabled?: boolean | boolean[];
19744
+ disabled?: boolean;
19745
+ };
19746
+ export interface Result extends DefaultPaginationResult {
19747
+ data: PopulatedDoc[];
19748
+ }
19749
+ }
19750
+ export namespace Get {
19751
+ export type ID = string;
19752
+ export type Params = { populatedKeys?: PopulatedKeys[] };
19753
+ export type Result = PopulatedDoc & { can_edit_types?: boolean };
19754
+ }
19755
+ export namespace Create {
19756
+ export type Body = CreateBody;
19757
+ export type Result = Data;
19758
+ }
19759
+ export namespace Update {
19760
+ export type ID = StringId;
19761
+ export type Body = UpdateBody;
19762
+ export type Result = Data;
19763
+ }
19764
+ export namespace Remove {
19765
+ export type ID = string;
19766
+ export type Result = Data;
19767
+ }
19768
+ }
19769
+
19770
+ export namespace ActivityFormV2Result {
19771
+ export const fieldType_enums = [
19772
+ "Text", // Long Text
19773
+ "String", // Short Text
19774
+ "Phone", // phone
19775
+ "Email", // email
19776
+ "Date", // Date
19777
+ // "Boolean", // No need any more in this form
19778
+ "Number", // Number
19779
+ "List", // List => custom List with ref or template (Allow multi, not only for media)
19780
+ "Separator", // Separator
19781
+ "Heading", // Heading
19782
+ "Media", // Media + phone + Image
19783
+ "Signature", // signature
19784
+ "DateTime", // timestamp
19785
+ "YesNo", // Yes/No/NA (with disable N/A option )
19786
+ "ProductBarcodeScan", // String
19787
+ "BarcodeScan", // String
19788
+ "GeoPoint", // { coordinates: [0, 0], type: "Point" }
19789
+ ] as const;
19790
+ export type FormV2FieldType = (typeof fieldType_enums)[number];
19791
+
19792
+ export interface FieldResult {
19793
+ _id?: string;
19794
+ field_id: string;
19795
+ name: string;
19796
+ type: FormV2FieldType;
19797
+ isArray?: boolean;
19798
+ isRequired?: boolean;
19799
+ custom_list?: string;
19800
+ formula_key?: string;
19801
+ is_calculated_field?: boolean;
19802
+ calculation_status?: "success" | "failed";
19803
+ calculation_error?: any[];
19804
+ score?: number;
19805
+ is_completed?: boolean;
19806
+ result:
19807
+ | string[]
19808
+ | number[]
19809
+ | ["yes"]
19810
+ | ["no"]
19811
+ | ["na"]
19812
+ | []
19813
+ | { coordinates: [number, number]; type: "Point" }[]
19814
+ | {
19815
+ _id: string;
19816
+ value: string | number;
19817
+ type: "Number" | "String";
19818
+ score?: number;
19819
+ }[];
19820
+ }
19821
+
19822
+ export interface DivisionResult {
19823
+ _id?: string;
19824
+ division_id: string;
19825
+ name: string;
19826
+ score?: number;
19827
+ is_completed?: boolean;
19828
+ fields: FieldResult[];
19829
+ }
19830
+
19831
+ export interface Data {
19832
+ _id: StringId;
19833
+ creator: AdminOrRepOrTenantOrClient;
19834
+ editor?: AdminOrRepOrTenantOrClient;
19835
+ serial_number: SerialNumber;
19836
+ teams: StringId[];
19837
+ tags: StringId[];
19838
+ time: number;
19839
+ client?: StringId;
19840
+ client_name?: string;
19841
+ visit?: StringId;
19842
+ visit_id?: string;
19843
+ route?: StringId;
19844
+ workorder?: StringId;
19845
+ sync_id: string;
19846
+ // mobile data
19847
+ geo_tag?: GeoTag;
19848
+ geoPoint?: GeoPoint;
19849
+ platform?: string;
19850
+ version_name?: string;
19851
+ battery_level?: number;
19852
+ device_brand?: string;
19853
+ device_os?: string;
19854
+ device_os_version?: string;
19855
+ device_model?: string;
19856
+ identifier?: number;
19857
+ device_id?: string;
19858
+ device_unique_id?: string;
19859
+ network_state?: number;
19860
+ time_zone?: string;
19861
+ job_start_time?: number;
19862
+ job_end_time?: number;
19863
+ job_duration?: number;
19864
+ form_id: StringId;
19865
+ results: DivisionResult[];
19866
+ score?: number;
19867
+ is_completed: boolean;
19868
+ company_namespace: string[];
19869
+ createdAt: Date;
19870
+ updatedAt: Date;
19871
+ }
19872
+
19873
+ export interface CreateBody {
19874
+ creator: AdminOrRepOrTenantOrClient;
19875
+ serial_number?: SerialNumber;
19876
+ teams?: StringId[];
19877
+ tags?: StringId[];
19878
+ time?: number;
19879
+ client?: StringId;
19880
+ client_name?: string;
19881
+ visit?: StringId;
19882
+ visit_id?: string;
19883
+ route?: StringId;
19884
+ workorder?: StringId;
19885
+ sync_id: string;
19886
+ geo_tag?: GeoTag;
19887
+ geoPoint?: GeoPoint;
19888
+ platform?: string;
19889
+ version_name?: string;
19890
+ battery_level?: number;
19891
+ device_brand?: string;
19892
+ device_os?: string;
19893
+ device_os_version?: string;
19894
+ device_model?: string;
19895
+ identifier?: number;
19896
+ device_id?: string;
19897
+ device_unique_id?: string;
19898
+ network_state?: number;
19899
+ time_zone?: string;
19900
+ job_start_time?: number;
19901
+ job_end_time?: number;
19902
+ job_duration?: number;
19903
+ form_id: StringId;
19904
+ results: DivisionResult[];
19905
+ score?: number;
19906
+ is_completed?: boolean;
19907
+ company_namespace?: string[];
19908
+ }
19909
+ export type UpdateBody = Partial<Data>;
19910
+
19911
+ export type PopulatedDoc = Data & {
19912
+ presentation_populated?: CLMPresentation.Data;
19913
+ sequence_populated?: Pick<
19914
+ CLMSequence.Data,
19915
+ "position" | "_id" | "product" | "presentation"
19916
+ >[];
19917
+ photo_media_populated?: PopulatedMediaStorage & {
19918
+ ContentLength?: number;
19919
+ };
19920
+ };
19921
+
19922
+ type PopulatedKeys =
19923
+ | "custom_list"
19924
+ | "client"
19925
+ | "workorder"
19926
+ | "visit"
19927
+ | "route"
19928
+ | "form_id"
19929
+ | "teams"
19930
+ | "tags"
19931
+ | "media";
19932
+
19933
+ export namespace Find {
19934
+ export type Params = DefaultPaginationQueryParams & {
19935
+ populatedKeys?: PopulatedKeys | PopulatedKeys[];
19936
+ _id?: StringId | StringId[];
19937
+ search?: string;
19938
+ from_time?: number;
19939
+ to_time?: number;
19940
+ client?: StringId | StringId[];
19941
+ tags?: StringId | StringId[];
19942
+ CLIENT_TAGS?: StringId | StringId[];
19943
+ AREA_TAGS?: StringId | StringId[];
19944
+ form_id?: StringId | StringId[];
19945
+ teams?: StringId | StringId[];
19946
+ route?: StringId | StringId[];
19947
+ is_completed?: boolean;
19948
+ from_score?: number;
19949
+ to_score?: number;
19950
+ score?: number | number[];
19951
+ "creator._id"?: StringId | StringId[];
19952
+ "creator.type"?: Data["creator"]["type"] | Data["creator"]["type"][];
19953
+ visit_id?: string | string[];
19954
+ visit?: StringId | StringId[];
19955
+ workorder?: StringId | StringId[];
19956
+ "serial_number.formatted"?: string | string[];
19957
+ };
19958
+ export interface Result extends DefaultPaginationResult {
19959
+ data: PopulatedDoc[];
19960
+ }
19961
+ }
19962
+ export namespace Get {
19963
+ export type ID = string;
19964
+ export type Params = { populatedKeys?: PopulatedKeys[] };
19965
+ export type Result = PopulatedDoc & { can_edit_types?: boolean };
19966
+ }
19967
+ export namespace Create {
19968
+ export type Body = CreateBody;
19969
+ export type Result = Data;
19970
+ }
19971
+ export namespace Update {
19972
+ export type ID = StringId;
19973
+ export type Body = UpdateBody;
19974
+ export type Result = Data;
19975
+ }
19976
+ }
19807
19977
  }
19808
19978
 
19809
19979
  export type StringId = string;