repzo 1.0.108 → 1.0.109

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.
@@ -4669,30 +4669,99 @@ export namespace Service {
4669
4669
 
4670
4670
  export namespace Workorder {
4671
4671
  export interface WorkorderSchema {
4672
- _id: string;
4673
- creator?: AdminCreator | RepCreator | ClientCreator;
4674
- editor?: AdminCreator | RepCreator | ClientCreator;
4675
- name?: string;
4672
+ _id: StringId;
4673
+ name: string;
4676
4674
  local_name?: string;
4677
- description?: string;
4678
4675
  disabled: boolean;
4679
- integration_meta?: { [key: string]: any };
4676
+ client: StringId;
4677
+ client_name: string;
4678
+ sync_id: string;
4680
4679
  status: WorkorderStatus;
4680
+ creator: AdminCreator | RepCreator | ClientCreator;
4681
+ editor?: AdminCreator | RepCreator | ClientCreator;
4682
+ workorder_categories: StringId[];
4683
+ description?: string;
4684
+ integration_meta?: { [key: string]: any };
4681
4685
  assets?: StringId[];
4682
4686
  asset_units?: StringId[];
4683
4687
  asset_part_units?: StringId[];
4684
- workorder_categories: StringId[];
4685
4688
  due_date?: number;
4686
4689
  start_date?: number;
4687
4690
  client_location: StringId;
4688
4691
  priority?: Priority;
4689
4692
  priority_human?: Priority_human;
4693
+ workorder_request?: string;
4694
+ serial_number?: SerialNumber;
4695
+ assigned_to?: StringId[];
4696
+ forms?: StringId[];
4697
+ time: number;
4698
+ is_overdue: boolean;
4699
+ opened_at: number;
4700
+ done_at: number;
4701
+ cancelled_at: number;
4702
+ inprogress_at: number;
4703
+ done_by?: AdminCreator | RepCreator | ClientCreator;
4704
+ cancelled_by?: AdminCreator | RepCreator | ClientCreator;
4705
+ opened_by?: AdminCreator | RepCreator | ClientCreator;
4706
+ inprogress_by?: AdminCreator | RepCreator | ClientCreator;
4707
+ build: Build[];
4708
+ calendars: Calendar[];
4709
+ builtAt: number;
4710
+ due_date_day?: string;
4711
+ last_done_at?: number;
4712
+ last_done_by?: AdminCreator | RepCreator | ClientCreator;
4713
+ resolve_time?: number;
4714
+ startsAt: string;
4715
+ endsAt?: string;
4716
+ is_dunning_allowed?: boolean;
4717
+ score_required_for_dunning?: boolean;
4718
+ min_score_required_for_dunning?: number;
4719
+ score?: number;
4720
+ is_completed?: boolean;
4721
+ forms_v2?: {
4722
+ form_id: StringId;
4723
+ form_activity_id?: StringId;
4724
+ completion_required_for_dunning?: boolean;
4725
+ score_required_for_dunning?: boolean;
4726
+ min_score_required_for_dunning?: number;
4727
+ score?: number;
4728
+ is_completed?: boolean;
4729
+ }[];
4730
+ teams?: StringId[];
4731
+ media?: StringId[];
4732
+ cover_photo?: StringId;
4733
+ custom_status?: StringId;
4734
+ contract?: StringId;
4735
+ parent_repeating_workorder?: StringId;
4736
+ parent_repeating_day?: string;
4737
+ filter_asset_units_by_location?: boolean;
4738
+ company_namespace: string[];
4739
+ createdAt: Date;
4740
+ updatedAt: Date;
4741
+ }
4742
+ export interface PopulatedData {
4743
+ _id: StringId;
4744
+ name: string;
4745
+ local_name?: string;
4746
+ disabled: boolean;
4690
4747
  client: StringId;
4691
4748
  client_name: string;
4749
+ sync_id: string;
4750
+ status: WorkorderStatus;
4751
+ creator: AdminCreator | RepCreator | ClientCreator;
4752
+ editor?: AdminCreator | RepCreator | ClientCreator;
4753
+ workorder_categories: StringId[];
4754
+ description?: string;
4755
+ integration_meta?: { [key: string]: any };
4756
+ assets?: StringId[];
4757
+ asset_units?: StringId[];
4758
+ asset_part_units?: StringId[];
4759
+ due_date?: number;
4760
+ start_date?: number;
4761
+ client_location: StringId;
4762
+ priority?: Priority;
4763
+ priority_human?: Priority_human;
4692
4764
  workorder_request?: string;
4693
- createdAt?: Date;
4694
- updatedAt?: Date;
4695
- company_namespace: string[];
4696
4765
  serial_number?: SerialNumber;
4697
4766
  assigned_to?: StringId[];
4698
4767
  forms?: StringId[];
@@ -4709,13 +4778,39 @@ export namespace Service {
4709
4778
  build: Build[];
4710
4779
  calendars: Calendar[];
4711
4780
  builtAt: number;
4712
- due_date_day: string;
4713
- last_done_at: number;
4714
- last_done_by: AdminCreator | RepCreator | ClientCreator;
4715
- resolve_time: number;
4716
- sync_id: string;
4781
+ due_date_day?: string;
4782
+ last_done_at?: number;
4783
+ last_done_by?: AdminCreator | RepCreator | ClientCreator;
4784
+ resolve_time?: number;
4717
4785
  startsAt: string;
4718
- endsAt: string;
4786
+ endsAt?: string;
4787
+ is_dunning_allowed?: boolean;
4788
+ score_required_for_dunning?: boolean;
4789
+ min_score_required_for_dunning?: number;
4790
+ score?: number;
4791
+ is_completed?: boolean;
4792
+ forms_v2?: {
4793
+ form_id:
4794
+ | StringId
4795
+ | { _id: StringId; name: string; local_name?: string }; // Pick<FormV2.Data, "_id"|"name"|"local_name">
4796
+ form_activity_id?: StringId;
4797
+ completion_required_for_dunning?: boolean;
4798
+ score_required_for_dunning?: boolean;
4799
+ min_score_required_for_dunning?: number;
4800
+ score?: number;
4801
+ is_completed?: boolean;
4802
+ }[];
4803
+ teams?: StringId[];
4804
+ media?: StringId[];
4805
+ cover_photo?: StringId;
4806
+ custom_status?: StringId;
4807
+ contract?: StringId;
4808
+ parent_repeating_workorder?: StringId;
4809
+ parent_repeating_day?: string;
4810
+ filter_asset_units_by_location?: boolean;
4811
+ company_namespace: string[];
4812
+ createdAt: Date;
4813
+ updatedAt: Date;
4719
4814
  teams_populated?: Pick<Team.TeamSchema, "name">;
4720
4815
  client_populated?: Pick<Client.ClientSchema, "client_code" | "name">;
4721
4816
  asset_units_populated?: AssetUnitsPopulated[];
@@ -4744,38 +4839,23 @@ export namespace Service {
4744
4839
  forms_populated?: FormPopulated[];
4745
4840
  media_populated?: MediaPopulated;
4746
4841
  cover_photo_populated?: MediaPopulated;
4747
- is_dunning_allowed?: boolean;
4748
- score_required_for_dunning?: boolean;
4749
- min_score_required_for_dunning?: number;
4750
- score?: number;
4751
- is_completed?: boolean;
4752
- forms_v2?: {
4753
- form_id: StringId;
4754
- form_activity_id?: StringId;
4755
- completion_required_for_dunning?: boolean;
4756
- score_required_for_dunning?: boolean;
4757
- min_score_required_for_dunning?: number;
4758
- score?: number;
4759
- is_completed?: boolean;
4760
- }[];
4761
- teams?: StringId[];
4762
- media?: StringId[];
4763
- cover_photo?: StringId;
4764
- custom_status?: StringId;
4765
- contract?: StringId;
4766
- parent_repeating_workorder?: StringId;
4767
- parent_repeating_day?: string;
4768
- filter_asset_units_by_location?: boolean;
4842
+ contract_populated?: {
4843
+ _id: StringId;
4844
+ serial_number: SerialNumber;
4845
+ title?: string;
4846
+ external_serial_number?: string;
4847
+ status?: "open" | "closed" | "canceled";
4848
+ }; // Pick<Contract.Data,"_id" | "serial_number" | "title" | "external_serial_number" | "status">;
4769
4849
  }
4770
4850
  export interface CreateBody {
4771
- company_namespace: string[];
4851
+ company_namespace?: string[];
4772
4852
  creator?: AdminCreator | RepCreator | ClientCreator;
4773
4853
  name: string;
4774
4854
  local_name?: string;
4775
4855
  description?: string;
4776
4856
  disabled?: boolean;
4777
4857
  integration_meta?: { [key: string]: any };
4778
- status: WorkorderStatus;
4858
+ status?: WorkorderStatus;
4779
4859
  assets?: StringId[];
4780
4860
  asset_units?: StringId[];
4781
4861
  asset_part_units?: StringId[];
@@ -4794,22 +4874,37 @@ export namespace Service {
4794
4874
  calendars: Calendar[];
4795
4875
  parent_repeating_workorder?: StringId;
4796
4876
  due_date_day?: string;
4797
- last_done_at: number;
4798
- last_done_by: AdminCreator | RepCreator | ClientCreator;
4799
- resolve_time: number;
4877
+ last_done_at?: number;
4878
+ last_done_by?: AdminCreator | RepCreator | ClientCreator;
4879
+ resolve_time?: number;
4800
4880
  sync_id: string;
4801
- opened_at: number;
4802
- time: number;
4803
- opened_by: AdminCreator | RepCreator | ClientCreator;
4881
+ opened_at?: number;
4882
+ time?: number;
4883
+ opened_by?: AdminCreator | RepCreator | ClientCreator;
4804
4884
  teams?: StringId[];
4805
4885
  media?: StringId[];
4806
4886
  cover_photo?: StringId;
4807
4887
  custom_status?: StringId;
4808
4888
  contract?: StringId;
4889
+ is_dunning_allowed?: boolean;
4890
+ score_required_for_dunning?: boolean;
4891
+ min_score_required_for_dunning?: number;
4892
+ score?: number;
4893
+ is_completed?: boolean;
4894
+ forms_v2?: {
4895
+ form_id: StringId;
4896
+ form_activity_id?: StringId;
4897
+ completion_required_for_dunning?: boolean;
4898
+ score_required_for_dunning?: boolean;
4899
+ min_score_required_for_dunning?: number;
4900
+ score?: number;
4901
+ is_completed?: boolean;
4902
+ }[];
4903
+ filter_asset_units_by_location?: boolean;
4809
4904
  }
4810
4905
  export interface UpdateBody {
4811
- company_namespace: string[];
4812
- _id?: string;
4906
+ company_namespace?: string[];
4907
+ _id?: StringId;
4813
4908
  creator?: AdminCreator | RepCreator | ClientCreator;
4814
4909
  editor?: AdminCreator | RepCreator | ClientCreator;
4815
4910
  name?: string;
@@ -4817,40 +4912,40 @@ export namespace Service {
4817
4912
  description?: string;
4818
4913
  disabled?: boolean;
4819
4914
  integration_meta?: { [key: string]: any };
4820
- status: WorkorderStatus;
4821
- assets?: string[];
4822
- asset_units?: string[];
4915
+ status?: WorkorderStatus;
4916
+ assets?: StringId[];
4917
+ asset_units?: StringId[];
4823
4918
  asset_part_units?: StringId[];
4824
- workorder_categories: string[];
4919
+ workorder_categories?: string[];
4825
4920
  due_date?: number;
4826
4921
  start_date?: number;
4827
- client_location: string;
4922
+ client_location: StringId;
4828
4923
  priority?: Priority;
4829
4924
  priority_human?: Priority_human;
4830
- client: string;
4925
+ client?: StringId;
4831
4926
  client_name?: string;
4832
- workorder_request?: string;
4927
+ workorder_request?: StringId;
4833
4928
  createdAt?: Date;
4834
4929
  updatedAt?: Date;
4835
4930
  serial_number?: SerialNumber;
4836
- assigned_to?: string[];
4837
- forms?: string[];
4838
- time: number;
4839
- is_overdue: boolean;
4840
- opened_at: number;
4841
- done_at: number;
4842
- cancelled_at: number;
4843
- inprogress_at: number;
4931
+ assigned_to?: StringId[];
4932
+ forms?: StringId[];
4933
+ time?: number;
4934
+ is_overdue?: boolean;
4935
+ opened_at?: number;
4936
+ done_at?: number;
4937
+ cancelled_at?: number;
4938
+ inprogress_at?: number;
4844
4939
  done_by?: AdminCreator | RepCreator | ClientCreator;
4845
4940
  cancelled_by?: AdminCreator | RepCreator | ClientCreator;
4846
4941
  opened_by?: AdminCreator | RepCreator | ClientCreator;
4847
4942
  inprogress_by?: AdminCreator | RepCreator | ClientCreator;
4848
- calendars: Calendar[];
4943
+ calendars?: Calendar[];
4849
4944
  parent_repeating_workorder?: string;
4850
4945
  due_date_day?: string;
4851
- last_done_at: number;
4852
- last_done_by: AdminCreator | RepCreator | ClientCreator;
4853
- resolve_time: number;
4946
+ last_done_at?: number;
4947
+ last_done_by?: AdminCreator | RepCreator | ClientCreator;
4948
+ resolve_time?: number;
4854
4949
  sync_id?: string;
4855
4950
  teams?: StringId[];
4856
4951
  media?: StringId[];
@@ -4877,24 +4972,26 @@ export namespace Service {
4877
4972
  | "forms"
4878
4973
  | "media"
4879
4974
  | "cover_photo"
4880
- | "teams";
4975
+ | "teams"
4976
+ | "forms_v2"
4977
+ | "contract";
4881
4978
  export namespace Find {
4882
4979
  export type Params = DefaultPaginationQueryParams & {
4883
- name?: string;
4884
- _id?: string;
4885
- assigned_to?: string[];
4886
- priority?: Priority;
4887
- priority_human?: Priority_human;
4888
- status?: WorkorderStatus;
4889
- workorder_categories?: string[];
4890
- client_location?: string;
4891
- client?: string;
4892
- assets?: string[];
4893
- asset_units?: string[];
4894
- asset_part_units?: StringId[];
4980
+ name?: string | string[];
4981
+ _id?: StringId | StringId[];
4982
+ assigned_to?: StringId | StringId[];
4983
+ priority?: Priority | Priority[];
4984
+ priority_human?: Priority_human | Priority_human[];
4985
+ status?: WorkorderStatus | WorkorderStatus[];
4986
+ workorder_categories?: StringId | StringId[];
4987
+ client_location?: StringId | StringId[];
4988
+ client?: StringId | StringId[];
4989
+ assets?: StringId | StringId[];
4990
+ asset_units?: StringId | StringId[];
4991
+ asset_part_units?: StringId | StringId[];
4895
4992
  due_date?: number;
4896
4993
  start_date?: number;
4897
- forms?: string[];
4994
+ forms?: StringId | StringId[];
4898
4995
  from_createdAt?: number;
4899
4996
  to_createdAt?: number;
4900
4997
  from_updatedAt?: number;
@@ -4903,10 +5000,23 @@ export namespace Service {
4903
5000
  to_start_date?: number;
4904
5001
  from_due_date?: number;
4905
5002
  to_due_date?: number;
4906
- teams?: string[];
5003
+ teams?: StringId | StringId[];
5004
+ is_dunning_allowed?: boolean | boolean[];
5005
+ is_completed?: boolean | boolean[];
5006
+ from_score?: number;
5007
+ to_score?: number;
5008
+ score?: number;
5009
+ contract?: StringId | StringId[];
5010
+ "forms_v2.form_id"?: StringId | StringId[];
5011
+ started?: boolean;
5012
+ assignedToMe?: boolean;
5013
+ search?: string;
5014
+ populatedKeys?: PopulatedKeys | PopulatedKeys[];
5015
+ sortBy?: { field: SortingKeys; type: "asc" | "desc" }[];
5016
+ [key: string]: any; // integration_meta.
4907
5017
  };
4908
5018
  export interface Result extends DefaultPaginationResult {
4909
- data: WorkorderSchema[];
5019
+ data: WorkorderSchema[] | PopulatedData[];
4910
5020
  absolute_total: number;
4911
5021
  page_total: number;
4912
5022
  }
@@ -4917,7 +5027,20 @@ export namespace Service {
4917
5027
  populatedKeys?: PopulatedKeys[];
4918
5028
  sortPage?: SortingKeys;
4919
5029
  }
4920
- export type Result = WorkorderSchema;
5030
+ export type Result = WorkorderSchema | PopulatedData;
5031
+ }
5032
+ export namespace Create {
5033
+ export type Body = CreateBody;
5034
+ export type Result = Data;
5035
+ }
5036
+ export namespace Update {
5037
+ export type ID = string;
5038
+ export type Body = UpdateBody;
5039
+ export type Result = Data;
5040
+ }
5041
+ export namespace Remove {
5042
+ export type ID = string;
5043
+ export type Result = Data;
4921
5044
  }
4922
5045
  }
4923
5046
 
@@ -5668,9 +5791,9 @@ export namespace Service {
5668
5791
  skip_promos?: boolean;
5669
5792
  skipped_promotions?: { _id: StringId; name?: string; ref?: string }[];
5670
5793
  partially_returned_from?: StringId;
5671
- partially_returned_to?: StringId;
5794
+ partially_returned_to?: StringId[];
5672
5795
  partially_returned_from_serial_number?: SerialNumber;
5673
- partially_returned_to_serial_number?: SerialNumber;
5796
+ partially_returned_to_serial_number?: SerialNumber[];
5674
5797
  discount_amount_float?: number;
5675
5798
  net_total?: number;
5676
5799
  tax_amount_after_deduction_float?: number;
@@ -11032,6 +11155,518 @@ export namespace Service {
11032
11155
  export type Result = Data;
11033
11156
  }
11034
11157
  }
11158
+
11159
+ export namespace Settings {
11160
+ export type Separator = "," | " " | "." | "'";
11161
+
11162
+ export interface EmailFilter {
11163
+ id?: string;
11164
+ key: string;
11165
+ operator: "eq" | "ne" | "in" | "nin" | "gt" | "gte" | "lt" | "lte";
11166
+ value: any[];
11167
+ }
11168
+
11169
+ export interface SalesSettings {
11170
+ currency: string;
11171
+ name_on_invoice?: string;
11172
+ invoice_footer?: string;
11173
+ logo?: string;
11174
+ logo_media?: StringId | PopulatedMediaStorage;
11175
+ tax_number?: string;
11176
+ default_payment_type?: "cash" | "credit";
11177
+ saudi_law?: boolean;
11178
+ handle_integrated_client_balance?: boolean;
11179
+ dot_separator?: Separator;
11180
+ thousands_separator?: Separator;
11181
+ number_of_digits_after_dot_separator?: 0 | 1 | 2 | 3;
11182
+ hide_line_item_tax?: boolean;
11183
+ line_total_key?:
11184
+ | "line_total"
11185
+ | "total_before_tax"
11186
+ | "lineTotalAfterDeduction";
11187
+ return_invoice_title?: string;
11188
+ return_invoice_local_title?: string;
11189
+ invoice_title?: string;
11190
+ invoice_local_title?: string;
11191
+ proforma_title?: string;
11192
+ proforma_local_title?: string;
11193
+ show_total_in_words?: boolean;
11194
+ address_1?: string;
11195
+ address_2?: string;
11196
+ prevent_negative_convert_to_invoice_stock?: boolean;
11197
+ empty_proforma_cart_at_visit_start_by_same_creator?: boolean;
11198
+ empty_proforma_cart_at_visit_start_by_any_creator?: boolean;
11199
+ empty_fullinvoice_cart_at_visit_start_by_same_creator?: boolean;
11200
+ empty_fullinvoice_cart_at_visit_start_by_any_creator?: boolean;
11201
+ enforce_serial_number_by_server?: boolean;
11202
+ invoice_advanced_serial_number_format?: {
11203
+ format: {
11204
+ year_format?: "YYYY" | "YY";
11205
+ month_format?: "M" | "MM" | "MMM" | "MMMM";
11206
+ day_format?: "D" | "DD";
11207
+ counter_length_fixed?: boolean;
11208
+ counter_length?: number;
11209
+ id_format: string;
11210
+ };
11211
+ counter: number;
11212
+ };
11213
+ activate_advanced_serial_number?: boolean;
11214
+ enable_variant_batches_at_invoice?: boolean;
11215
+ enable_variant_batches_at_proforma?: boolean;
11216
+ enable_variant_batches_at_return_invoice?: boolean;
11217
+ prevent_negative_transfer_stock?: boolean;
11218
+ currency_subunit?: string;
11219
+ local_currency?: string;
11220
+ local_currency_subunit?: string;
11221
+ currency_factor?: 100 | 1000;
11222
+ }
11223
+
11224
+ export interface Data {
11225
+ _id: string;
11226
+ company_namespace: string[];
11227
+ live_location: { active: boolean; from?: string; to?: string };
11228
+ use_original_image_compression?: boolean;
11229
+ use_client_specific_sales_settings?: boolean;
11230
+ use_client_specific_sales_settings_for_payment?: boolean;
11231
+ use_client_specific_sales_settings_for_client_statement?: boolean;
11232
+ disable_ubl_integration_for_return_invoice?: boolean;
11233
+ sales: SalesSettings;
11234
+ geofencing: {
11235
+ visit_start: boolean;
11236
+ visit_end: boolean;
11237
+ radius: number;
11238
+ visit_strict: boolean;
11239
+ };
11240
+ mail_list: {
11241
+ invoice_sales: {
11242
+ name: string;
11243
+ email: string;
11244
+ filters?: EmailFilter[];
11245
+ }[];
11246
+ mocking: { name: string; email: string }[];
11247
+ sales_order: { name: string; email: string; filters?: EmailFilter[] }[];
11248
+ photo: { name: string; email: string; filters?: EmailFilter[] }[];
11249
+ live_location: {
11250
+ name: string;
11251
+ email: string;
11252
+ filters?: EmailFilter[];
11253
+ }[];
11254
+ location_off: {
11255
+ name: string;
11256
+ email: string;
11257
+ filters?: EmailFilter[];
11258
+ }[];
11259
+ location_on: { name: string; email: string; filters?: EmailFilter[] }[];
11260
+ contract_expiry: { name: string; email: string }[];
11261
+ contract_near_expiry: { name: string; email: string }[];
11262
+ contract_installment_due: { name: string; email: string }[];
11263
+ contract_installment_near_due: { name: string; email: string }[];
11264
+ };
11265
+ promotions: {
11266
+ enforcement_mode:
11267
+ | "all_in_inventory"
11268
+ | "all"
11269
+ | "gift_in_inventory"
11270
+ | "gift"
11271
+ | "custom";
11272
+ apply_hidden_price: boolean;
11273
+ apply_all_promotions: boolean;
11274
+ applying_sort: { [key: string]: -1 | 1 }[];
11275
+ force_cash_only: boolean;
11276
+ allow_manual_discounts?: boolean;
11277
+ manual_discounts_limit_percentage: number;
11278
+ manual_discounts_limit_value?: number;
11279
+ promotions_enabled: boolean;
11280
+ round_discounted_price: boolean;
11281
+ };
11282
+ teams_shared_collections: string[];
11283
+ days_of_work:
11284
+ | "Sunday"
11285
+ | "Monday"
11286
+ | "Tuesday"
11287
+ | "Wednesday"
11288
+ | "Thursday"
11289
+ | "Friday"
11290
+ | "Saturday";
11291
+ signUpMethod: "email" | "phone";
11292
+ calculate_target_for_absent_days: boolean;
11293
+ disable_module_custom_validator: boolean;
11294
+ activate_ubl_integration: boolean;
11295
+ last_activate_ubl_integration_time?: number;
11296
+ visit: { manual_product_line_selection: boolean };
11297
+ custom_status: {
11298
+ use_custom_status_transfer?: boolean;
11299
+ use_system_status_transfer?: boolean;
11300
+ use_custom_status_payment?: boolean;
11301
+ use_system_status_payment?: boolean;
11302
+ use_custom_status_fullinvoice?: boolean;
11303
+ use_system_status_fullinvoice?: boolean;
11304
+ use_custom_status_proforma?: boolean;
11305
+ use_system_status_proforma?: boolean;
11306
+ use_custom_status_workorder?: boolean;
11307
+ use_system_status_workorder?: boolean;
11308
+ };
11309
+ business_apps: {
11310
+ code: string;
11311
+ services: {
11312
+ permission: string;
11313
+ teams_shared: "shared" | "unshared";
11314
+ }[];
11315
+ }[];
11316
+ form: { overwrite_serial_number?: boolean; allow_create_v1: boolean };
11317
+ workorder?: {
11318
+ workorder_teams_follow_client?: boolean;
11319
+ workorder_request_teams_follow_client?: boolean;
11320
+ send_email_at_contract_expiry?: boolean;
11321
+ send_email_at_contract_near_expiry?: boolean;
11322
+ send_email_at_contract_installment_due?: boolean;
11323
+ send_email_at_contract_installment_near_due?: boolean;
11324
+ contract_near_expiry_days: number;
11325
+ contract_installment_near_due_days: number;
11326
+ workorder_near_due_days?: number;
11327
+ };
11328
+ notifications?: {
11329
+ calendar_update?: boolean;
11330
+ transfer_update?: boolean;
11331
+ cycle_update?: boolean;
11332
+ client_update?: boolean;
11333
+ approval_request_update?: boolean;
11334
+ workorder_update?: boolean;
11335
+ workorder_start?: boolean;
11336
+ workorder_near_due?: boolean;
11337
+ activity_note?: boolean;
11338
+ activity_form?: boolean;
11339
+ activity_photo?: boolean;
11340
+ activity_audit?: boolean;
11341
+ activity_task?: boolean;
11342
+ activity_availability?: boolean;
11343
+ activity_planogram?: boolean;
11344
+ activity_shelfsahre?: boolean;
11345
+ activity_checkout_display?: boolean;
11346
+ activity_secondary_display?: boolean;
11347
+ };
11348
+ asset_part?: { prevent_negative_asset_part_inventory: boolean };
11349
+ default_lang?: "en" | "ar";
11350
+ second_lang?: "en" | "ar";
11351
+ report_value_delimiter?: "|" | "," | " " | "." | "-";
11352
+ rep_settings?: {
11353
+ rep_start_day_specific_time_frame_start: string;
11354
+ rep_start_day_specific_time_frame_end: string;
11355
+ };
11356
+ rep_permissions?: {
11357
+ rep_must_start_day_within_specific_time_frame: boolean;
11358
+ };
11359
+ createdAt: Date;
11360
+ updatedAt: Date;
11361
+ }
11362
+
11363
+ export interface PopulatedDoc {
11364
+ _id: string;
11365
+ company_namespace: string[];
11366
+ live_location?: { active: boolean; from?: string; to?: string };
11367
+ use_original_image_compression?: boolean;
11368
+ use_client_specific_sales_settings?: boolean;
11369
+ use_client_specific_sales_settings_for_payment?: boolean;
11370
+ use_client_specific_sales_settings_for_client_statement?: boolean;
11371
+ disable_ubl_integration_for_return_invoice?: boolean;
11372
+ sales: SalesSettings;
11373
+ geofencing?: {
11374
+ visit_start: boolean;
11375
+ visit_end: boolean;
11376
+ radius: number;
11377
+ visit_strict: boolean;
11378
+ };
11379
+ mail_list?: {
11380
+ invoice_sales?: {
11381
+ name: string;
11382
+ email: string;
11383
+ filters?: EmailFilter[];
11384
+ }[];
11385
+ mocking?: { name: string; email: string }[];
11386
+ sales_order?: {
11387
+ name: string;
11388
+ email: string;
11389
+ filters?: EmailFilter[];
11390
+ }[];
11391
+ photo?: { name: string; email: string; filters?: EmailFilter[] }[];
11392
+ live_location?: {
11393
+ name: string;
11394
+ email: string;
11395
+ filters?: EmailFilter[];
11396
+ }[];
11397
+ location_off?: {
11398
+ name: string;
11399
+ email: string;
11400
+ filters?: EmailFilter[];
11401
+ }[];
11402
+ location_on?: {
11403
+ name: string;
11404
+ email: string;
11405
+ filters?: EmailFilter[];
11406
+ }[];
11407
+ contract_expiry?: { name: string; email: string }[];
11408
+ contract_near_expiry?: { name: string; email: string }[];
11409
+ contract_installment_due?: { name: string; email: string }[];
11410
+ contract_installment_near_due?: { name: string; email: string }[];
11411
+ };
11412
+ promotions?: {
11413
+ enforcement_mode?:
11414
+ | "all_in_inventory"
11415
+ | "all"
11416
+ | "gift_in_inventory"
11417
+ | "gift"
11418
+ | "custom";
11419
+ apply_hidden_price?: boolean;
11420
+ apply_all_promotions?: boolean;
11421
+ applying_sort?: { [key: string]: -1 | 1 }[];
11422
+ force_cash_only?: boolean;
11423
+ allow_manual_discounts?: boolean;
11424
+ manual_discounts_limit_percentage?: number;
11425
+ manual_discounts_limit_value?: number;
11426
+ promotions_enabled?: boolean;
11427
+ round_discounted_price?: boolean;
11428
+ };
11429
+ teams_shared_collections?: string[];
11430
+ days_of_work?:
11431
+ | "Sunday"
11432
+ | "Monday"
11433
+ | "Tuesday"
11434
+ | "Wednesday"
11435
+ | "Thursday"
11436
+ | "Friday"
11437
+ | "Saturday";
11438
+ signUpMethod?: "email" | "phone";
11439
+ calculate_target_for_absent_days?: boolean;
11440
+ disable_module_custom_validator?: boolean;
11441
+ activate_ubl_integration?: boolean;
11442
+ last_activate_ubl_integration_time?: number;
11443
+ visit?: { manual_product_line_selection: boolean };
11444
+ custom_status?: {
11445
+ use_custom_status_transfer?: boolean;
11446
+ use_system_status_transfer?: boolean;
11447
+ use_custom_status_payment?: boolean;
11448
+ use_system_status_payment?: boolean;
11449
+ use_custom_status_fullinvoice?: boolean;
11450
+ use_system_status_fullinvoice?: boolean;
11451
+ use_custom_status_proforma?: boolean;
11452
+ use_system_status_proforma?: boolean;
11453
+ use_custom_status_workorder?: boolean;
11454
+ use_system_status_workorder?: boolean;
11455
+ };
11456
+ business_apps?: {
11457
+ code: string;
11458
+ services: {
11459
+ permission: StringId | { name: string; _id: StringId };
11460
+ teams_shared: "shared" | "unshared";
11461
+ }[];
11462
+ }[];
11463
+ form?: { overwrite_serial_number?: boolean; allow_create_v1: boolean };
11464
+ workorder?: {
11465
+ workorder_teams_follow_client?: boolean;
11466
+ workorder_request_teams_follow_client?: boolean;
11467
+ send_email_at_contract_expiry?: boolean;
11468
+ send_email_at_contract_near_expiry?: boolean;
11469
+ send_email_at_contract_installment_due?: boolean;
11470
+ send_email_at_contract_installment_near_due?: boolean;
11471
+ contract_near_expiry_days?: number;
11472
+ contract_installment_near_due_days?: number;
11473
+ workorder_near_due_days?: number;
11474
+ };
11475
+ notifications?: {
11476
+ calendar_update?: boolean;
11477
+ transfer_update?: boolean;
11478
+ cycle_update?: boolean;
11479
+ client_update?: boolean;
11480
+ approval_request_update?: boolean;
11481
+ workorder_update?: boolean;
11482
+ workorder_start?: boolean;
11483
+ workorder_near_due?: boolean;
11484
+ activity_note?: boolean;
11485
+ activity_form?: boolean;
11486
+ activity_photo?: boolean;
11487
+ activity_audit?: boolean;
11488
+ activity_task?: boolean;
11489
+ activity_availability?: boolean;
11490
+ activity_planogram?: boolean;
11491
+ activity_shelfsahre?: boolean;
11492
+ activity_checkout_display?: boolean;
11493
+ activity_secondary_display?: boolean;
11494
+ };
11495
+ asset_part?: { prevent_negative_asset_part_inventory: boolean };
11496
+ default_lang?: "en" | "ar";
11497
+ second_lang?: "en" | "ar";
11498
+ report_value_delimiter?: "|" | "," | " " | "." | "-";
11499
+ rep_settings?: {
11500
+ rep_start_day_specific_time_frame_start: string;
11501
+ rep_start_day_specific_time_frame_end: string;
11502
+ };
11503
+ rep_permissions?: {
11504
+ rep_must_start_day_within_specific_time_frame: boolean;
11505
+ };
11506
+ createdAt: Date;
11507
+ updatedAt: Date;
11508
+ }
11509
+
11510
+ export namespace Find {
11511
+ export type Params = DefaultPaginationQueryParams & {
11512
+ _id?: StringId | StringId[];
11513
+ job?: StringId | StringId[];
11514
+ template?: StringId | StringId[];
11515
+ page_number?: number;
11516
+ proforma?: StringId | StringId[];
11517
+ status?: string | string[];
11518
+ };
11519
+ export interface Result extends DefaultPaginationResult {
11520
+ data: Data[];
11521
+ }
11522
+ }
11523
+
11524
+ export namespace Get {
11525
+ export type ID = string;
11526
+ export type Result = Data;
11527
+ }
11528
+
11529
+ export interface UpdateBody {
11530
+ live_location?: { active: boolean; from?: string; to?: string };
11531
+ use_original_image_compression?: boolean;
11532
+ use_client_specific_sales_settings?: boolean;
11533
+ use_client_specific_sales_settings_for_payment?: boolean;
11534
+ use_client_specific_sales_settings_for_client_statement?: boolean;
11535
+ disable_ubl_integration_for_return_invoice?: boolean;
11536
+ sales?: SalesSettings;
11537
+ geofencing?: {
11538
+ visit_start: boolean;
11539
+ visit_end: boolean;
11540
+ radius: number;
11541
+ visit_strict: boolean;
11542
+ };
11543
+ mail_list?: {
11544
+ invoice_sales: {
11545
+ name: string;
11546
+ email: string;
11547
+ filters?: EmailFilter[];
11548
+ }[];
11549
+ mocking: { name: string; email: string }[];
11550
+ sales_order: { name: string; email: string; filters?: EmailFilter[] }[];
11551
+ photo: { name: string; email: string; filters?: EmailFilter[] }[];
11552
+ live_location: {
11553
+ name: string;
11554
+ email: string;
11555
+ filters?: EmailFilter[];
11556
+ }[];
11557
+ location_off: {
11558
+ name: string;
11559
+ email: string;
11560
+ filters?: EmailFilter[];
11561
+ }[];
11562
+ location_on: { name: string; email: string; filters?: EmailFilter[] }[];
11563
+ contract_expiry: { name: string; email: string }[];
11564
+ contract_near_expiry: { name: string; email: string }[];
11565
+ contract_installment_due: { name: string; email: string }[];
11566
+ contract_installment_near_due: { name: string; email: string }[];
11567
+ };
11568
+ promotions?: {
11569
+ enforcement_mode:
11570
+ | "all_in_inventory"
11571
+ | "all"
11572
+ | "gift_in_inventory"
11573
+ | "gift"
11574
+ | "custom";
11575
+ apply_hidden_price: boolean;
11576
+ apply_all_promotions: boolean;
11577
+ applying_sort: { [key: string]: -1 | 1 }[];
11578
+ force_cash_only: boolean;
11579
+ allow_manual_discounts: boolean;
11580
+ manual_discounts_limit_percentage: number;
11581
+ manual_discounts_limit_value: number;
11582
+ promotions_enabled: boolean;
11583
+ round_discounted_price: boolean;
11584
+ };
11585
+ teams_shared_collections?: string[];
11586
+ days_of_work?:
11587
+ | "Sunday"
11588
+ | "Monday"
11589
+ | "Tuesday"
11590
+ | "Wednesday"
11591
+ | "Thursday"
11592
+ | "Friday"
11593
+ | "Saturday";
11594
+ signUpMethod?: "email" | "phone";
11595
+ calculate_target_for_absent_days?: boolean;
11596
+ disable_module_custom_validator?: boolean;
11597
+ activate_ubl_integration?: boolean;
11598
+ last_activate_ubl_integration_time?: number;
11599
+ visit?: { manual_product_line_selection: boolean };
11600
+ custom_status?: {
11601
+ use_custom_status_transfer?: boolean;
11602
+ use_system_status_transfer?: boolean;
11603
+ use_custom_status_payment?: boolean;
11604
+ use_system_status_payment?: boolean;
11605
+ use_custom_status_fullinvoice?: boolean;
11606
+ use_system_status_fullinvoice?: boolean;
11607
+ use_custom_status_proforma?: boolean;
11608
+ use_system_status_proforma?: boolean;
11609
+ use_custom_status_workorder?: boolean;
11610
+ use_system_status_workorder?: boolean;
11611
+ };
11612
+ business_apps?: {
11613
+ code: string;
11614
+ services: {
11615
+ permission: string;
11616
+ teams_shared: "shared" | "unshared";
11617
+ }[];
11618
+ }[];
11619
+ form?: { overwrite_serial_number?: boolean; allow_create_v1: boolean };
11620
+ workorder?: {
11621
+ workorder_teams_follow_client?: boolean;
11622
+ workorder_request_teams_follow_client?: boolean;
11623
+ send_email_at_contract_expiry?: boolean;
11624
+ send_email_at_contract_near_expiry?: boolean;
11625
+ send_email_at_contract_installment_due?: boolean;
11626
+ send_email_at_contract_installment_near_due?: boolean;
11627
+ contract_near_expiry_days?: number;
11628
+ contract_installment_near_due_days?: number;
11629
+ workorder_near_due_days?: number;
11630
+ };
11631
+ notifications?: {
11632
+ calendar_update: boolean;
11633
+ transfer_update: boolean;
11634
+ cycle_update: boolean;
11635
+ client_update: boolean;
11636
+ approval_request_update: boolean;
11637
+ workorder_update: boolean;
11638
+ workorder_start: boolean;
11639
+ workorder_near_due: boolean;
11640
+ activity_note: boolean;
11641
+ activity_form: boolean;
11642
+ activity_photo: boolean;
11643
+ activity_audit: boolean;
11644
+ activity_task: boolean;
11645
+ activity_availability: boolean;
11646
+ activity_planogram: boolean;
11647
+ activity_shelfsahre: boolean;
11648
+ activity_checkout_display: boolean;
11649
+ activity_secondary_display: boolean;
11650
+ };
11651
+ asset_part?: { prevent_negative_asset_part_inventory: boolean };
11652
+ default_lang?: "en" | "ar";
11653
+ second_lang?: "en" | "ar";
11654
+ report_value_delimiter?: "|" | "," | " " | "." | "-";
11655
+ rep_settings?: {
11656
+ rep_start_day_specific_time_frame_start: string;
11657
+ rep_start_day_specific_time_frame_end: string;
11658
+ };
11659
+ rep_permissions?: {
11660
+ rep_must_start_day_within_specific_time_frame: boolean;
11661
+ };
11662
+ }
11663
+
11664
+ export namespace Update {
11665
+ export type ID = StringId;
11666
+ export type Body = UpdateBody;
11667
+ export type Result = Data;
11668
+ }
11669
+ }
11035
11670
  }
11036
11671
 
11037
11672
  export type StringId = string;