repzo 1.0.247 → 1.0.249

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.
@@ -2858,6 +2858,7 @@ export namespace Service {
2858
2858
  rep_must_add_delivery_date_on_invoice?: boolean;
2859
2859
  rep_can_view_stock_on_transfers?: boolean;
2860
2860
  rep_must_invoice_items_from_cross_inventory_and_msl?: boolean;
2861
+ rep_can_create_client_line_approval_request?: boolean;
2861
2862
  }
2862
2863
  interface TargetResults {
2863
2864
  totalPoints: number;
@@ -3140,6 +3141,7 @@ export namespace Service {
3140
3141
  "permissions.rep_can_access_sales_reports"?: boolean;
3141
3142
  "permissions.rep_must_add_delivery_date_on_sales_order"?: boolean;
3142
3143
  "permissions.rep_must_add_delivery_date_on_invoice"?: boolean;
3144
+ "permissions.rep_can_create_client_line_approval_request"?: boolean;
3143
3145
  "permissions.rep_can_view_stock_on_transfers"?: boolean;
3144
3146
  "permissions.rep_must_invoice_items_from_cross_inventory_and_msl"?: boolean;
3145
3147
  "settings.rep_must_end_day_after"?: `${number}:${number}`;
@@ -5554,9 +5556,7 @@ export namespace Service {
5554
5556
  score?: number;
5555
5557
  is_completed?: boolean;
5556
5558
  forms_v2?: {
5557
- form_id:
5558
- | StringId
5559
- | { _id: StringId; name: string; local_name?: string }; // Pick<FormV2.Data, "_id"|"name"|"local_name">
5559
+ form_id: StringId | Pick<FormV2.Data, "_id" | "name" | "local_name">;
5560
5560
  form_activity_id?: StringId;
5561
5561
  completion_required_for_dunning?: boolean;
5562
5562
  score_required_for_dunning?: boolean;
@@ -13233,7 +13233,7 @@ export namespace Service {
13233
13233
  _id: StringId;
13234
13234
  app_code: string;
13235
13235
  document_id?: StringId;
13236
- document_type: "client" | "visit";
13236
+ document_type: "client" | "visit" | "client-line";
13237
13237
  sync_id: string;
13238
13238
  method?: "create" | "update" | "delete" | "patch";
13239
13239
  visit_id?: string;
@@ -13243,7 +13243,8 @@ export namespace Service {
13243
13243
  | "skip_visit_from_route"
13244
13244
  | "create_client"
13245
13245
  | "update_client"
13246
- | "delete_client";
13246
+ | "delete_client"
13247
+ | "update_client_line";
13247
13248
  subtype?:
13248
13249
  | "client_details"
13249
13250
  | "client_assigned_to"
@@ -13316,7 +13317,7 @@ export namespace Service {
13316
13317
  };
13317
13318
  export interface CreateBody {
13318
13319
  document_id?: StringId;
13319
- document_type: "client" | "visit";
13320
+ document_type: "client" | "visit" | "client-line";
13320
13321
  sync_id: string;
13321
13322
  method?: "create" | "update" | "delete" | "patch";
13322
13323
  visit_id?: string;
@@ -13326,7 +13327,8 @@ export namespace Service {
13326
13327
  | "skip_visit_from_route"
13327
13328
  | "create_client"
13328
13329
  | "update_client"
13329
- | "delete_client";
13330
+ | "delete_client"
13331
+ | "update_client_line";
13330
13332
  subtype?:
13331
13333
  | "client_details"
13332
13334
  | "client_assigned_to"
@@ -13391,7 +13393,7 @@ export namespace Service {
13391
13393
  _id?: StringId;
13392
13394
  app_code?: string;
13393
13395
  document_id?: StringId;
13394
- document_type?: "client" | "visit";
13396
+ document_type?: "client" | "visit" | "client-line";
13395
13397
  sync_id?: string;
13396
13398
  method?: "create" | "update" | "delete" | "patch";
13397
13399
  visit_id?: string;
@@ -13401,7 +13403,8 @@ export namespace Service {
13401
13403
  | "skip_visit_from_route"
13402
13404
  | "create_client"
13403
13405
  | "update_client"
13404
- | "delete_client";
13406
+ | "delete_client"
13407
+ | "update_client_line";
13405
13408
  subtype?:
13406
13409
  | "client_details"
13407
13410
  | "client_assigned_to"
@@ -15109,353 +15112,65 @@ export namespace Service {
15109
15112
  }
15110
15113
  }
15111
15114
 
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
- }
15115
+ export namespace ActivityItemStatus {
15116
+ export type ItemStatus =
15117
+ | "current_user"
15118
+ | "non_user"
15119
+ | "generic_user"
15120
+ | "competitor_user"
15121
+ | "other";
15225
15122
 
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
- };
15123
+ export interface Item {
15124
+ product: string;
15125
+ product_name: string;
15126
+ status: ItemStatus;
15127
+ item_status_type?: string;
15128
+ feedback?: string;
15129
+ note?: string;
15130
+ feedback_current_user?: number;
15131
+ previous_status?: ItemStatus;
15132
+ previous_status_id?: string;
15133
+ previous_user?: string;
15134
+ previous_user_name?: string;
15135
+ previous_time?: number;
15274
15136
  }
15275
15137
 
15276
15138
  export interface Data {
15277
15139
  _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[];
15140
+ items: Item[];
15141
+ geoPoint: GeoPoint;
15142
+ time: number;
15143
+ tags?: string[];
15144
+ visit_id: string;
15145
+ user: string;
15146
+ client: string;
15147
+ visit?: string;
15148
+ client_name: string;
15149
+ user_name: string;
15150
+ sync_id: string;
15151
+ route?: string;
15152
+ platform?: string;
15153
+ version_name?: string;
15154
+ battery_level?: number;
15155
+ device_brand?: string;
15156
+ device_os?: string;
15157
+ device_os_version?: string;
15158
+ device_model?: string;
15159
+ time_zone?: string;
15160
+ identifier?: number;
15161
+ device_id?: string;
15162
+ device_unique_id?: string;
15163
+ teams?: string[];
15164
+ reviewed_by: ActivityReview[];
15165
+ network_state?: number;
15166
+ admin_notes: ActivityAdminNote[];
15167
+ comments: ActivityComment[];
15289
15168
  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;
15169
+ job_start_time?: number;
15170
+ job_end_time?: number;
15171
+ job_duration?: number;
15172
+ createdAt: string;
15173
+ updatedAt: string;
15459
15174
  }
15460
15175
  }
15461
15176
 
@@ -19804,6 +19519,466 @@ export namespace Service {
19804
19519
  export type Result = Data;
19805
19520
  }
19806
19521
  }
19522
+
19523
+ export namespace FormV2 {
19524
+ export interface Visibility {
19525
+ operator: "and" | "or";
19526
+ conditions: {
19527
+ division_id: string;
19528
+ field_id: string;
19529
+ type: "Boolean" | "List" | "YesNo"; // FieldType;
19530
+ custom_list?: string | CustomList.Data;
19531
+ operator: "lte" | "lt" | "gte" | "gt" | "eq" | "ne" | "in" | "nin";
19532
+ value: any[];
19533
+ }[];
19534
+ }
19535
+
19536
+ export const fieldType_enums = [
19537
+ "Text", // Long Text
19538
+ "String", // Short Text
19539
+ "Phone", // phone
19540
+ "Email", // email
19541
+ "Date", // Date
19542
+ // "Boolean", // No need any more in this form
19543
+ "Number", // Number
19544
+ "List", // List => custom List with ref or template (Allow multi, not only for media)
19545
+ "Separator", // Separator
19546
+ "Heading", // Heading
19547
+ "Media", // Media + phone + Image
19548
+ "Signature", // signature
19549
+ "DateTime", // timestamp
19550
+ "YesNo", // Yes/No/NA (with disable N/A option )
19551
+ "ProductBarcodeScan", // String
19552
+ "BarcodeScan", // String
19553
+ "GeoPoint", // { coordinates: [0, 0], type: "Point" }
19554
+ ] as const;
19555
+
19556
+ export type FormV2FieldType = (typeof fieldType_enums)[number];
19557
+ interface FieldPrintSettings {
19558
+ three_inch: {
19559
+ grid_column?: 1 | 2;
19560
+ alignment?: "right" | "left" | "center";
19561
+ border_width?: number;
19562
+ label_font_size?: number;
19563
+ value_font_size?: number;
19564
+ media_height?: number | string;
19565
+ media_width?: number | string;
19566
+ align_media?: "right" | "left" | "center";
19567
+ label_value_spacing?: number;
19568
+ is_hidden?: boolean;
19569
+ };
19570
+ }
19571
+ interface UsedField {
19572
+ code: string;
19573
+ key: string;
19574
+ data_type: AvailableField.Data["data_type"];
19575
+ field_type:
19576
+ | "template_field"
19577
+ // | "calculated_field"
19578
+ | "source_attribute"
19579
+ | "activity_attribute";
19580
+ label: string;
19581
+ isArray?: boolean;
19582
+ formula_key: string;
19583
+ field_id?: string;
19584
+ example_value: AvailableField.Data["data_type"];
19585
+ manipulator_function?: string;
19586
+ lookup?: {
19587
+ from?: string;
19588
+ localField?: string;
19589
+ foreignField?: string;
19590
+ as?: string;
19591
+ select?: string;
19592
+ unwind?: boolean;
19593
+ filter?: {
19594
+ input?: string;
19595
+ as: string;
19596
+ cond: any;
19597
+ };
19598
+ };
19599
+ }
19600
+ export interface Field {
19601
+ _id?: string;
19602
+ name: string;
19603
+ local_name?: string;
19604
+ description?: string;
19605
+ local_description?: string;
19606
+ type: FormV2FieldType;
19607
+ isArray?: boolean;
19608
+ isRequired?: boolean;
19609
+ disabled?: boolean;
19610
+ formula_key?: string;
19611
+ scoring_enabled?: boolean;
19612
+ required_for_completion?: boolean;
19613
+ visibility?: Visibility;
19614
+ default_value?: any[];
19615
+ custom_list?: string | CustomList.Data;
19616
+ is_na_allowed?: boolean;
19617
+ score_accumulator_type?: "max" | "sum";
19618
+ yes_score?: number;
19619
+ no_score?: number;
19620
+ na_score?: number;
19621
+ exist_score?: number;
19622
+ media?: (string | MediaDoc)[];
19623
+ invisible: boolean;
19624
+ parent_field?: string;
19625
+ custom_list_element?: string;
19626
+ force_live_photo?: boolean;
19627
+ min?: number;
19628
+ max?: number;
19629
+ is_integer?: boolean;
19630
+ styles?: "check_list" | "toggle_yes_no_na" | "toggle_yes_no" | "buttons";
19631
+ field_print_settings?: FieldPrintSettings;
19632
+ is_calculated_field?: boolean;
19633
+ formula?: string;
19634
+ used_fields?: UsedField[];
19635
+ }
19636
+
19637
+ interface Division {
19638
+ _id: string;
19639
+ name: string;
19640
+ local_name?: string;
19641
+ description?: string;
19642
+ local_description?: string;
19643
+ disabled?: boolean;
19644
+ min_questions_to_answer_for_completion?: number;
19645
+ min_score_for_completion?: number;
19646
+ visibility?: Visibility;
19647
+ fields: Field[];
19648
+ }
19649
+ interface PrintSettings {
19650
+ three_inch: {
19651
+ grid_columns?: 1 | 2;
19652
+ logo_height?: number | string;
19653
+ logo_width?: number | string;
19654
+ align_logo?: "right" | "left" | "center";
19655
+ space_y?: number;
19656
+ };
19657
+ A_four: {
19658
+ banner_media?: string | MediaDoc;
19659
+ banner_height: number;
19660
+ banner_width: number;
19661
+ align_banner: "right" | "left" | "center";
19662
+ header_label_font_size: number;
19663
+ header_value_font_size: number;
19664
+ align_header: "right" | "left" | "center";
19665
+ division_name_font_size: number;
19666
+ align_division: "right" | "left" | "center";
19667
+ grid_columns: 1 | 2 | 3 | 4;
19668
+ space_y: number;
19669
+ field_label_size: number;
19670
+ field_value_size: number;
19671
+ footer_media?: string | MediaDoc;
19672
+ align_footer_media: "right" | "left" | "center";
19673
+ footer_media_height: number;
19674
+ footer_media_width: number;
19675
+ footer_details: string;
19676
+ align_footer_details: "right" | "left" | "center";
19677
+ compressed_media_size:
19678
+ | "original"
19679
+ | "small"
19680
+ | "medium"
19681
+ | "large"
19682
+ | "extra";
19683
+ view_custom_list_element: boolean;
19684
+ };
19685
+ }
19686
+ export interface Data {
19687
+ _id: string;
19688
+ disabled: boolean;
19689
+ name: string;
19690
+ local_name?: string;
19691
+ description?: string;
19692
+ local_description?: string;
19693
+ copied_from?: string;
19694
+ scoring_enabled?: boolean;
19695
+ completion_rules_enabled?: boolean;
19696
+ min_questions_to_answer_for_completion?: number;
19697
+ min_score_for_completion?: number;
19698
+ divisions: Division[];
19699
+ company_namespace: string[];
19700
+ print_settings?: PrintSettings;
19701
+ createdAt: Date;
19702
+ updatedAt: Date;
19703
+ }
19704
+
19705
+ export interface CreateBody {
19706
+ disabled?: boolean;
19707
+ name: string;
19708
+ local_name?: string;
19709
+ description?: string;
19710
+ local_description?: string;
19711
+ copied_from?: string;
19712
+ scoring_enabled?: boolean;
19713
+ completion_rules_enabled?: boolean;
19714
+ min_questions_to_answer_for_completion?: number;
19715
+ min_score_for_completion?: number;
19716
+ divisions: Division[];
19717
+ company_namespace?: string[];
19718
+ print_settings?: PrintSettings;
19719
+ }
19720
+ export type UpdateBody = Partial<Data>;
19721
+
19722
+ export type PopulatedDoc = Data & {
19723
+ presentation_populated?: CLMPresentation.Data;
19724
+ sequence_populated?: Pick<
19725
+ CLMSequence.Data,
19726
+ "position" | "_id" | "product" | "presentation"
19727
+ >[];
19728
+ photo_media_populated?: PopulatedMediaStorage & {
19729
+ ContentLength?: number;
19730
+ };
19731
+ };
19732
+
19733
+ type PopulatedKeys =
19734
+ | "custom_list"
19735
+ | "media"
19736
+ | "banner_media"
19737
+ | "footer_media";
19738
+ type SortingKeys = "_id" | "position" | "updatedAt";
19739
+
19740
+ export namespace Find {
19741
+ export type Params = DefaultPaginationQueryParams & {
19742
+ sortBy?: { field: SortingKeys; type: "asc" | "desc" }[];
19743
+ populatedKeys?: PopulatedKeys | PopulatedKeys[];
19744
+ _id?: StringId | StringId[];
19745
+ search?: string;
19746
+ name?: string;
19747
+ scoring_enabled?: boolean | boolean[];
19748
+ completion_rules_enabled?: boolean | boolean[];
19749
+ disabled?: boolean;
19750
+ };
19751
+ export interface Result extends DefaultPaginationResult {
19752
+ data: PopulatedDoc[];
19753
+ }
19754
+ }
19755
+ export namespace Get {
19756
+ export type ID = string;
19757
+ export type Params = { populatedKeys?: PopulatedKeys[] };
19758
+ export type Result = PopulatedDoc & { can_edit_types?: boolean };
19759
+ }
19760
+ export namespace Create {
19761
+ export type Body = CreateBody;
19762
+ export type Result = Data;
19763
+ }
19764
+ export namespace Update {
19765
+ export type ID = StringId;
19766
+ export type Body = UpdateBody;
19767
+ export type Result = Data;
19768
+ }
19769
+ export namespace Remove {
19770
+ export type ID = string;
19771
+ export type Result = Data;
19772
+ }
19773
+ }
19774
+
19775
+ export namespace ActivityFormV2Result {
19776
+ export const fieldType_enums = [
19777
+ "Text", // Long Text
19778
+ "String", // Short Text
19779
+ "Phone", // phone
19780
+ "Email", // email
19781
+ "Date", // Date
19782
+ // "Boolean", // No need any more in this form
19783
+ "Number", // Number
19784
+ "List", // List => custom List with ref or template (Allow multi, not only for media)
19785
+ "Separator", // Separator
19786
+ "Heading", // Heading
19787
+ "Media", // Media + phone + Image
19788
+ "Signature", // signature
19789
+ "DateTime", // timestamp
19790
+ "YesNo", // Yes/No/NA (with disable N/A option )
19791
+ "ProductBarcodeScan", // String
19792
+ "BarcodeScan", // String
19793
+ "GeoPoint", // { coordinates: [0, 0], type: "Point" }
19794
+ ] as const;
19795
+ export type FormV2FieldType = (typeof fieldType_enums)[number];
19796
+
19797
+ export interface FieldResult {
19798
+ _id?: string;
19799
+ field_id: string;
19800
+ name: string;
19801
+ type: FormV2FieldType;
19802
+ isArray?: boolean;
19803
+ isRequired?: boolean;
19804
+ custom_list?: string;
19805
+ formula_key?: string;
19806
+ is_calculated_field?: boolean;
19807
+ calculation_status?: "success" | "failed";
19808
+ calculation_error?: any[];
19809
+ score?: number;
19810
+ is_completed?: boolean;
19811
+ result:
19812
+ | string[]
19813
+ | number[]
19814
+ | ["yes"]
19815
+ | ["no"]
19816
+ | ["na"]
19817
+ | []
19818
+ | { coordinates: [number, number]; type: "Point" }[]
19819
+ | {
19820
+ _id: string;
19821
+ value: string | number;
19822
+ type: "Number" | "String";
19823
+ score?: number;
19824
+ }[];
19825
+ }
19826
+
19827
+ export interface DivisionResult {
19828
+ _id?: string;
19829
+ division_id: string;
19830
+ name: string;
19831
+ score?: number;
19832
+ is_completed?: boolean;
19833
+ fields: FieldResult[];
19834
+ }
19835
+
19836
+ export interface Data {
19837
+ _id: StringId;
19838
+ creator: AdminOrRepOrTenantOrClient;
19839
+ editor?: AdminOrRepOrTenantOrClient;
19840
+ serial_number: SerialNumber;
19841
+ teams: StringId[];
19842
+ tags: StringId[];
19843
+ time: number;
19844
+ client?: StringId;
19845
+ client_name?: string;
19846
+ visit?: StringId;
19847
+ visit_id?: string;
19848
+ route?: StringId;
19849
+ workorder?: StringId;
19850
+ sync_id: string;
19851
+ // mobile data
19852
+ geo_tag?: GeoTag;
19853
+ geoPoint?: GeoPoint;
19854
+ platform?: string;
19855
+ version_name?: string;
19856
+ battery_level?: number;
19857
+ device_brand?: string;
19858
+ device_os?: string;
19859
+ device_os_version?: string;
19860
+ device_model?: string;
19861
+ identifier?: number;
19862
+ device_id?: string;
19863
+ device_unique_id?: string;
19864
+ network_state?: number;
19865
+ time_zone?: string;
19866
+ job_start_time?: number;
19867
+ job_end_time?: number;
19868
+ job_duration?: number;
19869
+ form_id: StringId;
19870
+ results: DivisionResult[];
19871
+ score?: number;
19872
+ is_completed: boolean;
19873
+ company_namespace: string[];
19874
+ createdAt: Date;
19875
+ updatedAt: Date;
19876
+ }
19877
+
19878
+ export interface CreateBody {
19879
+ creator: AdminOrRepOrTenantOrClient;
19880
+ serial_number?: SerialNumber;
19881
+ teams?: StringId[];
19882
+ tags?: StringId[];
19883
+ time?: number;
19884
+ client?: StringId;
19885
+ client_name?: string;
19886
+ visit?: StringId;
19887
+ visit_id?: string;
19888
+ route?: StringId;
19889
+ workorder?: StringId;
19890
+ sync_id: string;
19891
+ geo_tag?: GeoTag;
19892
+ geoPoint?: GeoPoint;
19893
+ platform?: string;
19894
+ version_name?: string;
19895
+ battery_level?: number;
19896
+ device_brand?: string;
19897
+ device_os?: string;
19898
+ device_os_version?: string;
19899
+ device_model?: string;
19900
+ identifier?: number;
19901
+ device_id?: string;
19902
+ device_unique_id?: string;
19903
+ network_state?: number;
19904
+ time_zone?: string;
19905
+ job_start_time?: number;
19906
+ job_end_time?: number;
19907
+ job_duration?: number;
19908
+ form_id: StringId;
19909
+ results: DivisionResult[];
19910
+ score?: number;
19911
+ is_completed?: boolean;
19912
+ company_namespace?: string[];
19913
+ }
19914
+ export type UpdateBody = Partial<Data>;
19915
+
19916
+ export type PopulatedDoc = Data & {
19917
+ presentation_populated?: CLMPresentation.Data;
19918
+ sequence_populated?: Pick<
19919
+ CLMSequence.Data,
19920
+ "position" | "_id" | "product" | "presentation"
19921
+ >[];
19922
+ photo_media_populated?: PopulatedMediaStorage & {
19923
+ ContentLength?: number;
19924
+ };
19925
+ };
19926
+
19927
+ type PopulatedKeys =
19928
+ | "custom_list"
19929
+ | "client"
19930
+ | "workorder"
19931
+ | "visit"
19932
+ | "route"
19933
+ | "form_id"
19934
+ | "teams"
19935
+ | "tags"
19936
+ | "media";
19937
+
19938
+ export namespace Find {
19939
+ export type Params = DefaultPaginationQueryParams & {
19940
+ populatedKeys?: PopulatedKeys | PopulatedKeys[];
19941
+ _id?: StringId | StringId[];
19942
+ search?: string;
19943
+ from_time?: number;
19944
+ to_time?: number;
19945
+ client?: StringId | StringId[];
19946
+ tags?: StringId | StringId[];
19947
+ CLIENT_TAGS?: StringId | StringId[];
19948
+ AREA_TAGS?: StringId | StringId[];
19949
+ form_id?: StringId | StringId[];
19950
+ teams?: StringId | StringId[];
19951
+ route?: StringId | StringId[];
19952
+ is_completed?: boolean;
19953
+ from_score?: number;
19954
+ to_score?: number;
19955
+ score?: number | number[];
19956
+ "creator._id"?: StringId | StringId[];
19957
+ "creator.type"?: Data["creator"]["type"] | Data["creator"]["type"][];
19958
+ visit_id?: string | string[];
19959
+ visit?: StringId | StringId[];
19960
+ workorder?: StringId | StringId[];
19961
+ "serial_number.formatted"?: string | string[];
19962
+ };
19963
+ export interface Result extends DefaultPaginationResult {
19964
+ data: PopulatedDoc[];
19965
+ }
19966
+ }
19967
+ export namespace Get {
19968
+ export type ID = string;
19969
+ export type Params = { populatedKeys?: PopulatedKeys[] };
19970
+ export type Result = PopulatedDoc & { can_edit_types?: boolean };
19971
+ }
19972
+ export namespace Create {
19973
+ export type Body = CreateBody;
19974
+ export type Result = Data;
19975
+ }
19976
+ export namespace Update {
19977
+ export type ID = StringId;
19978
+ export type Body = UpdateBody;
19979
+ export type Result = Data;
19980
+ }
19981
+ }
19807
19982
  }
19808
19983
 
19809
19984
  export type StringId = string;