@flowselections/admin-installatietechniek 1.0.3 → 1.0.5

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.
Files changed (36) hide show
  1. package/dist-lib/components/AdminForInstallatieTechniek.d.ts +4 -0
  2. package/dist-lib/components/AdminForInstallatieTechniek.d.ts.map +1 -1
  3. package/dist-lib/components/AdminForInstallatieTechniek.js +223 -197
  4. package/dist-lib/components/ModuleAccessGuard.d.ts +15 -0
  5. package/dist-lib/components/ModuleAccessGuard.d.ts.map +1 -0
  6. package/dist-lib/components/ModuleAccessGuard.js +40 -0
  7. package/dist-lib/hooks/useModulePermission.d.ts +11 -4
  8. package/dist-lib/hooks/useModulePermission.d.ts.map +1 -1
  9. package/dist-lib/hooks/useModulePermission.js +33 -26
  10. package/dist-lib/index.d.ts +3 -3
  11. package/dist-lib/index.d.ts.map +1 -1
  12. package/dist-lib/index.js +2 -1
  13. package/dist-lib/integrations/supabase/auth-attacher.d.ts.map +1 -1
  14. package/dist-lib/integrations/supabase/auth-attacher.js +5 -1
  15. package/dist-lib/integrations/supabase/auth-middleware.d.ts +978 -133
  16. package/dist-lib/integrations/supabase/auth-middleware.d.ts.map +1 -1
  17. package/dist-lib/integrations/supabase/auth-middleware.js +21 -7
  18. package/dist-lib/integrations/supabase/client.d.ts +978 -133
  19. package/dist-lib/integrations/supabase/client.d.ts.map +1 -1
  20. package/dist-lib/integrations/supabase/client.server.d.ts +978 -133
  21. package/dist-lib/integrations/supabase/client.server.d.ts.map +1 -1
  22. package/dist-lib/integrations/supabase/types.d.ts +987 -137
  23. package/dist-lib/integrations/supabase/types.d.ts.map +1 -1
  24. package/dist-lib/lib/admin.functions.d.ts +78644 -2655
  25. package/dist-lib/lib/admin.functions.d.ts.map +1 -1
  26. package/dist-lib/lib/admin.functions.js +351 -174
  27. package/dist-lib/lib/moduleDiscovery.d.ts +7 -2
  28. package/dist-lib/lib/moduleDiscovery.d.ts.map +1 -1
  29. package/dist-lib/lib/moduleDiscovery.js +26 -11
  30. package/dist-lib/lib/permissions.server.d.ts +14 -0
  31. package/dist-lib/lib/permissions.server.d.ts.map +1 -0
  32. package/dist-lib/lib/permissions.server.js +26 -0
  33. package/package.json +1 -1
  34. package/dist-lib/hooks/useModuleOrder.d.ts +0 -30
  35. package/dist-lib/hooks/useModuleOrder.d.ts.map +0 -1
  36. package/dist-lib/hooks/useModuleOrder.js +0 -99
@@ -895,6 +895,126 @@ export type Database = {
895
895
  };
896
896
  Relationships: [];
897
897
  };
898
+ cao_holidays: {
899
+ Row: {
900
+ created_at: string;
901
+ description: string | null;
902
+ holiday_date: string;
903
+ id: string;
904
+ updated_at: string;
905
+ };
906
+ Insert: {
907
+ created_at?: string;
908
+ description?: string | null;
909
+ holiday_date: string;
910
+ id?: string;
911
+ updated_at?: string;
912
+ };
913
+ Update: {
914
+ created_at?: string;
915
+ description?: string | null;
916
+ holiday_date?: string;
917
+ id?: string;
918
+ updated_at?: string;
919
+ };
920
+ Relationships: [];
921
+ };
922
+ cao_settings: {
923
+ Row: {
924
+ auto_break_after_hours: number;
925
+ auto_break_minutes: number;
926
+ auto_break_unpaid: boolean;
927
+ auto_stop_after_hours: number;
928
+ callout_fee: number;
929
+ created_at: string;
930
+ daily_regular_hours: number;
931
+ default_hourly_rate: number;
932
+ id: string;
933
+ materials_markup_percent: number;
934
+ max_daily_hours: number;
935
+ max_weekly_hours: number;
936
+ meal_allowance_amount: number;
937
+ overtime_pct_178: number;
938
+ overtime_pct_189: number;
939
+ overtime_pct_212: number;
940
+ reminder_after_hours: number;
941
+ standby_evening_amount: number;
942
+ standby_weekend_amount: number;
943
+ travel_cost_per_km: number | null;
944
+ travel_cost_threshold_km: number | null;
945
+ travel_counts_as_work: boolean;
946
+ travel_hourly_rate: number;
947
+ travel_rate_per_hour: number;
948
+ travel_threshold_minutes: number;
949
+ updated_at: string;
950
+ weekend_always_212: boolean;
951
+ window_end: string;
952
+ window_start: string;
953
+ };
954
+ Insert: {
955
+ auto_break_after_hours?: number;
956
+ auto_break_minutes?: number;
957
+ auto_break_unpaid?: boolean;
958
+ auto_stop_after_hours?: number;
959
+ callout_fee?: number;
960
+ created_at?: string;
961
+ daily_regular_hours?: number;
962
+ default_hourly_rate?: number;
963
+ id?: string;
964
+ materials_markup_percent?: number;
965
+ max_daily_hours?: number;
966
+ max_weekly_hours?: number;
967
+ meal_allowance_amount?: number;
968
+ overtime_pct_178?: number;
969
+ overtime_pct_189?: number;
970
+ overtime_pct_212?: number;
971
+ reminder_after_hours?: number;
972
+ standby_evening_amount?: number;
973
+ standby_weekend_amount?: number;
974
+ travel_cost_per_km?: number | null;
975
+ travel_cost_threshold_km?: number | null;
976
+ travel_counts_as_work?: boolean;
977
+ travel_hourly_rate?: number;
978
+ travel_rate_per_hour?: number;
979
+ travel_threshold_minutes?: number;
980
+ updated_at?: string;
981
+ weekend_always_212?: boolean;
982
+ window_end?: string;
983
+ window_start?: string;
984
+ };
985
+ Update: {
986
+ auto_break_after_hours?: number;
987
+ auto_break_minutes?: number;
988
+ auto_break_unpaid?: boolean;
989
+ auto_stop_after_hours?: number;
990
+ callout_fee?: number;
991
+ created_at?: string;
992
+ daily_regular_hours?: number;
993
+ default_hourly_rate?: number;
994
+ id?: string;
995
+ materials_markup_percent?: number;
996
+ max_daily_hours?: number;
997
+ max_weekly_hours?: number;
998
+ meal_allowance_amount?: number;
999
+ overtime_pct_178?: number;
1000
+ overtime_pct_189?: number;
1001
+ overtime_pct_212?: number;
1002
+ reminder_after_hours?: number;
1003
+ standby_evening_amount?: number;
1004
+ standby_weekend_amount?: number;
1005
+ travel_cost_per_km?: number | null;
1006
+ travel_cost_threshold_km?: number | null;
1007
+ travel_counts_as_work?: boolean;
1008
+ travel_hourly_rate?: number;
1009
+ travel_rate_per_hour?: number;
1010
+ travel_threshold_minutes?: number;
1011
+ updated_at?: string;
1012
+ weekend_always_212?: boolean;
1013
+ window_end?: string;
1014
+ window_start?: string;
1015
+ };
1016
+ Relationships: [];
1017
+ };
898
1018
  carrier_shipping_rates: {
899
1019
  Row: {
900
1020
  carrier_id: string;
@@ -6646,6 +6766,7 @@ export type Database = {
6646
6766
  Row: {
6647
6767
  buyer_organization_id: string | null;
6648
6768
  connection_id: string;
6769
+ controlled_at: string | null;
6649
6770
  created_at: string;
6650
6771
  data: Json;
6651
6772
  floriday_id: string;
@@ -6657,6 +6778,7 @@ export type Database = {
6657
6778
  Insert: {
6658
6779
  buyer_organization_id?: string | null;
6659
6780
  connection_id: string;
6781
+ controlled_at?: string | null;
6660
6782
  created_at?: string;
6661
6783
  data: Json;
6662
6784
  floriday_id: string;
@@ -6668,6 +6790,7 @@ export type Database = {
6668
6790
  Update: {
6669
6791
  buyer_organization_id?: string | null;
6670
6792
  connection_id?: string;
6793
+ controlled_at?: string | null;
6671
6794
  created_at?: string;
6672
6795
  data?: Json;
6673
6796
  floriday_id?: string;
@@ -7601,6 +7724,54 @@ export type Database = {
7601
7724
  };
7602
7725
  Relationships: [];
7603
7726
  };
7727
+ invoice_timing_settings: {
7728
+ Row: {
7729
+ anchor: string;
7730
+ business_days_only: boolean;
7731
+ created_at: string;
7732
+ enabled: boolean;
7733
+ id: string;
7734
+ offset_days: number;
7735
+ pickup_anchor: string;
7736
+ pickup_business_days_only: boolean;
7737
+ pickup_offset_days: number;
7738
+ pickup_time_of_day: string;
7739
+ singleton: boolean;
7740
+ time_of_day: string;
7741
+ updated_at: string;
7742
+ };
7743
+ Insert: {
7744
+ anchor?: string;
7745
+ business_days_only?: boolean;
7746
+ created_at?: string;
7747
+ enabled?: boolean;
7748
+ id?: string;
7749
+ offset_days?: number;
7750
+ pickup_anchor?: string;
7751
+ pickup_business_days_only?: boolean;
7752
+ pickup_offset_days?: number;
7753
+ pickup_time_of_day?: string;
7754
+ singleton?: boolean;
7755
+ time_of_day?: string;
7756
+ updated_at?: string;
7757
+ };
7758
+ Update: {
7759
+ anchor?: string;
7760
+ business_days_only?: boolean;
7761
+ created_at?: string;
7762
+ enabled?: boolean;
7763
+ id?: string;
7764
+ offset_days?: number;
7765
+ pickup_anchor?: string;
7766
+ pickup_business_days_only?: boolean;
7767
+ pickup_offset_days?: number;
7768
+ pickup_time_of_day?: string;
7769
+ singleton?: boolean;
7770
+ time_of_day?: string;
7771
+ updated_at?: string;
7772
+ };
7773
+ Relationships: [];
7774
+ };
7604
7775
  itk_contact_persons: {
7605
7776
  Row: {
7606
7777
  created_at: string;
@@ -7924,7 +8095,6 @@ export type Database = {
7924
8095
  start_date: string;
7925
8096
  start_time: string | null;
7926
8097
  status: string;
7927
- tenant_id: string;
7928
8098
  updated_at: string;
7929
8099
  user_id: string;
7930
8100
  };
@@ -7942,7 +8112,6 @@ export type Database = {
7942
8112
  start_date: string;
7943
8113
  start_time?: string | null;
7944
8114
  status?: string;
7945
- tenant_id?: string;
7946
8115
  updated_at?: string;
7947
8116
  user_id: string;
7948
8117
  };
@@ -7960,7 +8129,6 @@ export type Database = {
7960
8129
  start_date?: string;
7961
8130
  start_time?: string | null;
7962
8131
  status?: string;
7963
- tenant_id?: string;
7964
8132
  updated_at?: string;
7965
8133
  user_id?: string;
7966
8134
  };
@@ -7969,14 +8137,14 @@ export type Database = {
7969
8137
  foreignKeyName: "leave_requests_monteur_id_fkey";
7970
8138
  columns: ["monteur_id"];
7971
8139
  isOneToOne: false;
7972
- referencedRelation: "monteurs";
8140
+ referencedRelation: "profiles";
7973
8141
  referencedColumns: ["id"];
7974
8142
  },
7975
8143
  {
7976
8144
  foreignKeyName: "leave_requests_user_id_fkey";
7977
8145
  columns: ["user_id"];
7978
8146
  isOneToOne: false;
7979
- referencedRelation: "monteurs";
8147
+ referencedRelation: "profiles";
7980
8148
  referencedColumns: ["id"];
7981
8149
  }
7982
8150
  ];
@@ -8867,6 +9035,45 @@ export type Database = {
8867
9035
  };
8868
9036
  Relationships: [];
8869
9037
  };
9038
+ logistics_plan_queue: {
9039
+ Row: {
9040
+ attempts: number;
9041
+ claimed_at: string | null;
9042
+ enqueued_at: string;
9043
+ error: string | null;
9044
+ id: string;
9045
+ next_attempt_at: string;
9046
+ order_id: string;
9047
+ reason: string;
9048
+ status: string;
9049
+ updated_at: string;
9050
+ };
9051
+ Insert: {
9052
+ attempts?: number;
9053
+ claimed_at?: string | null;
9054
+ enqueued_at?: string;
9055
+ error?: string | null;
9056
+ id?: string;
9057
+ next_attempt_at?: string;
9058
+ order_id: string;
9059
+ reason?: string;
9060
+ status?: string;
9061
+ updated_at?: string;
9062
+ };
9063
+ Update: {
9064
+ attempts?: number;
9065
+ claimed_at?: string | null;
9066
+ enqueued_at?: string;
9067
+ error?: string | null;
9068
+ id?: string;
9069
+ next_attempt_at?: string;
9070
+ order_id?: string;
9071
+ reason?: string;
9072
+ status?: string;
9073
+ updated_at?: string;
9074
+ };
9075
+ Relationships: [];
9076
+ };
8870
9077
  logistics_plan_runs: {
8871
9078
  Row: {
8872
9079
  created_at: string;
@@ -8945,6 +9152,24 @@ export type Database = {
8945
9152
  }
8946
9153
  ];
8947
9154
  };
9155
+ logistics_plan_settings: {
9156
+ Row: {
9157
+ key: string;
9158
+ updated_at: string;
9159
+ value: string;
9160
+ };
9161
+ Insert: {
9162
+ key: string;
9163
+ updated_at?: string;
9164
+ value: string;
9165
+ };
9166
+ Update: {
9167
+ key?: string;
9168
+ updated_at?: string;
9169
+ value?: string;
9170
+ };
9171
+ Relationships: [];
9172
+ };
8948
9173
  logistics_rebuffer_state: {
8949
9174
  Row: {
8950
9175
  created_at: string;
@@ -9665,14 +9890,17 @@ export type Database = {
9665
9890
  };
9666
9891
  mailbox_messages: {
9667
9892
  Row: {
9893
+ attachments: Json;
9668
9894
  body_html: string | null;
9669
9895
  body_text: string | null;
9896
+ cc_recipients: Json;
9670
9897
  connection_id: string | null;
9671
9898
  created_at: string;
9672
9899
  error_message: string | null;
9673
9900
  external_id: string | null;
9674
9901
  from_email: string | null;
9675
9902
  from_name: string | null;
9903
+ has_attachments: boolean;
9676
9904
  id: string;
9677
9905
  message_id: string | null;
9678
9906
  profile_id: string | null;
@@ -9680,18 +9908,22 @@ export type Database = {
9680
9908
  received_at: string | null;
9681
9909
  status: string;
9682
9910
  subject: string | null;
9911
+ to_recipients: Json;
9683
9912
  uid: number | null;
9684
9913
  updated_at: string;
9685
9914
  };
9686
9915
  Insert: {
9916
+ attachments?: Json;
9687
9917
  body_html?: string | null;
9688
9918
  body_text?: string | null;
9919
+ cc_recipients?: Json;
9689
9920
  connection_id?: string | null;
9690
9921
  created_at?: string;
9691
9922
  error_message?: string | null;
9692
9923
  external_id?: string | null;
9693
9924
  from_email?: string | null;
9694
9925
  from_name?: string | null;
9926
+ has_attachments?: boolean;
9695
9927
  id?: string;
9696
9928
  message_id?: string | null;
9697
9929
  profile_id?: string | null;
@@ -9699,18 +9931,22 @@ export type Database = {
9699
9931
  received_at?: string | null;
9700
9932
  status?: string;
9701
9933
  subject?: string | null;
9934
+ to_recipients?: Json;
9702
9935
  uid?: number | null;
9703
9936
  updated_at?: string;
9704
9937
  };
9705
9938
  Update: {
9939
+ attachments?: Json;
9706
9940
  body_html?: string | null;
9707
9941
  body_text?: string | null;
9942
+ cc_recipients?: Json;
9708
9943
  connection_id?: string | null;
9709
9944
  created_at?: string;
9710
9945
  error_message?: string | null;
9711
9946
  external_id?: string | null;
9712
9947
  from_email?: string | null;
9713
9948
  from_name?: string | null;
9949
+ has_attachments?: boolean;
9714
9950
  id?: string;
9715
9951
  message_id?: string | null;
9716
9952
  profile_id?: string | null;
@@ -9718,6 +9954,7 @@ export type Database = {
9718
9954
  received_at?: string | null;
9719
9955
  status?: string;
9720
9956
  subject?: string | null;
9957
+ to_recipients?: Json;
9721
9958
  uid?: number | null;
9722
9959
  updated_at?: string;
9723
9960
  };
@@ -10115,6 +10352,94 @@ export type Database = {
10115
10352
  };
10116
10353
  Relationships: [];
10117
10354
  };
10355
+ material_usage: {
10356
+ Row: {
10357
+ created_at: string;
10358
+ id: string;
10359
+ material_name: string;
10360
+ monteur_id: string | null;
10361
+ price_at_time: number;
10362
+ quantity_used: number;
10363
+ updated_at: string;
10364
+ van_inventory_id: string | null;
10365
+ work_order_id: string;
10366
+ };
10367
+ Insert: {
10368
+ created_at?: string;
10369
+ id?: string;
10370
+ material_name: string;
10371
+ monteur_id?: string | null;
10372
+ price_at_time?: number;
10373
+ quantity_used?: number;
10374
+ updated_at?: string;
10375
+ van_inventory_id?: string | null;
10376
+ work_order_id: string;
10377
+ };
10378
+ Update: {
10379
+ created_at?: string;
10380
+ id?: string;
10381
+ material_name?: string;
10382
+ monteur_id?: string | null;
10383
+ price_at_time?: number;
10384
+ quantity_used?: number;
10385
+ updated_at?: string;
10386
+ van_inventory_id?: string | null;
10387
+ work_order_id?: string;
10388
+ };
10389
+ Relationships: [
10390
+ {
10391
+ foreignKeyName: "material_usage_monteur_id_fkey";
10392
+ columns: ["monteur_id"];
10393
+ isOneToOne: false;
10394
+ referencedRelation: "profiles";
10395
+ referencedColumns: ["id"];
10396
+ },
10397
+ {
10398
+ foreignKeyName: "material_usage_van_inventory_id_fkey";
10399
+ columns: ["van_inventory_id"];
10400
+ isOneToOne: false;
10401
+ referencedRelation: "van_inventories";
10402
+ referencedColumns: ["id"];
10403
+ },
10404
+ {
10405
+ foreignKeyName: "material_usage_work_order_id_fkey";
10406
+ columns: ["work_order_id"];
10407
+ isOneToOne: false;
10408
+ referencedRelation: "work_orders";
10409
+ referencedColumns: ["id"];
10410
+ }
10411
+ ];
10412
+ };
10413
+ module_features: {
10414
+ Row: {
10415
+ created_at: string;
10416
+ feature_id: string;
10417
+ id: string;
10418
+ is_active: boolean;
10419
+ last_seen_at: string;
10420
+ module_id: string;
10421
+ name: string;
10422
+ };
10423
+ Insert: {
10424
+ created_at?: string;
10425
+ feature_id: string;
10426
+ id?: string;
10427
+ is_active?: boolean;
10428
+ last_seen_at?: string;
10429
+ module_id: string;
10430
+ name: string;
10431
+ };
10432
+ Update: {
10433
+ created_at?: string;
10434
+ feature_id?: string;
10435
+ id?: string;
10436
+ is_active?: boolean;
10437
+ last_seen_at?: string;
10438
+ module_id?: string;
10439
+ name?: string;
10440
+ };
10441
+ Relationships: [];
10442
+ };
10118
10443
  module_permissions: {
10119
10444
  Row: {
10120
10445
  created_at: string;
@@ -10145,6 +10470,7 @@ export type Database = {
10145
10470
  module_registry: {
10146
10471
  Row: {
10147
10472
  created_at: string;
10473
+ enforce: boolean;
10148
10474
  is_active: boolean;
10149
10475
  last_seen_at: string;
10150
10476
  module_id: string;
@@ -10154,6 +10480,7 @@ export type Database = {
10154
10480
  };
10155
10481
  Insert: {
10156
10482
  created_at?: string;
10483
+ enforce?: boolean;
10157
10484
  is_active?: boolean;
10158
10485
  last_seen_at?: string;
10159
10486
  module_id: string;
@@ -10163,6 +10490,7 @@ export type Database = {
10163
10490
  };
10164
10491
  Update: {
10165
10492
  created_at?: string;
10493
+ enforce?: boolean;
10166
10494
  is_active?: boolean;
10167
10495
  last_seen_at?: string;
10168
10496
  module_id?: string;
@@ -10223,65 +10551,6 @@ export type Database = {
10223
10551
  };
10224
10552
  Relationships: [];
10225
10553
  };
10226
- monteurs: {
10227
- Row: {
10228
- avatar_url: string | null;
10229
- color: string | null;
10230
- created_at: string;
10231
- email: string | null;
10232
- id: string;
10233
- is_active: boolean;
10234
- leave_balance_hours: number;
10235
- name: string;
10236
- persnr: number | null;
10237
- phone: string | null;
10238
- role: string;
10239
- tenant_id: string;
10240
- updated_at: string;
10241
- user_id: string | null;
10242
- };
10243
- Insert: {
10244
- avatar_url?: string | null;
10245
- color?: string | null;
10246
- created_at?: string;
10247
- email?: string | null;
10248
- id?: string;
10249
- is_active?: boolean;
10250
- leave_balance_hours?: number;
10251
- name: string;
10252
- persnr?: number | null;
10253
- phone?: string | null;
10254
- role?: string;
10255
- tenant_id: string;
10256
- updated_at?: string;
10257
- user_id?: string | null;
10258
- };
10259
- Update: {
10260
- avatar_url?: string | null;
10261
- color?: string | null;
10262
- created_at?: string;
10263
- email?: string | null;
10264
- id?: string;
10265
- is_active?: boolean;
10266
- leave_balance_hours?: number;
10267
- name?: string;
10268
- persnr?: number | null;
10269
- phone?: string | null;
10270
- role?: string;
10271
- tenant_id?: string;
10272
- updated_at?: string;
10273
- user_id?: string | null;
10274
- };
10275
- Relationships: [
10276
- {
10277
- foreignKeyName: "monteurs_tenant_id_fkey";
10278
- columns: ["tenant_id"];
10279
- isOneToOne: false;
10280
- referencedRelation: "tenants";
10281
- referencedColumns: ["id"];
10282
- }
10283
- ];
10284
- };
10285
10554
  nmbrs_component_mapping: {
10286
10555
  Row: {
10287
10556
  created_at: string;
@@ -10354,15 +10623,7 @@ export type Database = {
10354
10623
  nmbrs_employee_number?: string;
10355
10624
  updated_at?: string;
10356
10625
  };
10357
- Relationships: [
10358
- {
10359
- foreignKeyName: "nmbrs_employee_mapping_monteur_id_fkey";
10360
- columns: ["monteur_id"];
10361
- isOneToOne: true;
10362
- referencedRelation: "monteurs";
10363
- referencedColumns: ["id"];
10364
- }
10365
- ];
10626
+ Relationships: [];
10366
10627
  };
10367
10628
  nmbrs_export_lines: {
10368
10629
  Row: {
@@ -10411,13 +10672,6 @@ export type Database = {
10411
10672
  wage_code?: string;
10412
10673
  };
10413
10674
  Relationships: [
10414
- {
10415
- foreignKeyName: "nmbrs_export_lines_monteur_id_fkey";
10416
- columns: ["monteur_id"];
10417
- isOneToOne: false;
10418
- referencedRelation: "monteurs";
10419
- referencedColumns: ["id"];
10420
- },
10421
10675
  {
10422
10676
  foreignKeyName: "nmbrs_export_lines_run_id_fkey";
10423
10677
  columns: ["run_id"];
@@ -11268,22 +11522,61 @@ export type Database = {
11268
11522
  };
11269
11523
  Relationships: [];
11270
11524
  };
11271
- order_items: {
11525
+ order_invoice_links: {
11272
11526
  Row: {
11273
- crates_per_layer: number | null;
11527
+ attempts: number;
11274
11528
  created_at: string;
11529
+ error_message: string | null;
11275
11530
  id: string;
11276
- layers_per_cart: number | null;
11531
+ invoice_number: string | null;
11532
+ next_attempt_at: string;
11277
11533
  order_id: string;
11278
- plants_per_crate: number | null;
11279
- product_id: string | null;
11280
- product_name: string;
11281
- quantity: number;
11282
- unit: string;
11283
- unit_price: number | null;
11534
+ processed_at: string | null;
11535
+ status: string;
11536
+ updated_at: string;
11284
11537
  };
11285
11538
  Insert: {
11286
- crates_per_layer?: number | null;
11539
+ attempts?: number;
11540
+ created_at?: string;
11541
+ error_message?: string | null;
11542
+ id?: string;
11543
+ invoice_number?: string | null;
11544
+ next_attempt_at?: string;
11545
+ order_id: string;
11546
+ processed_at?: string | null;
11547
+ status?: string;
11548
+ updated_at?: string;
11549
+ };
11550
+ Update: {
11551
+ attempts?: number;
11552
+ created_at?: string;
11553
+ error_message?: string | null;
11554
+ id?: string;
11555
+ invoice_number?: string | null;
11556
+ next_attempt_at?: string;
11557
+ order_id?: string;
11558
+ processed_at?: string | null;
11559
+ status?: string;
11560
+ updated_at?: string;
11561
+ };
11562
+ Relationships: [];
11563
+ };
11564
+ order_items: {
11565
+ Row: {
11566
+ crates_per_layer: number | null;
11567
+ created_at: string;
11568
+ id: string;
11569
+ layers_per_cart: number | null;
11570
+ order_id: string;
11571
+ plants_per_crate: number | null;
11572
+ product_id: string | null;
11573
+ product_name: string;
11574
+ quantity: number;
11575
+ unit: string;
11576
+ unit_price: number | null;
11577
+ };
11578
+ Insert: {
11579
+ crates_per_layer?: number | null;
11287
11580
  created_at?: string;
11288
11581
  id?: string;
11289
11582
  layers_per_cart?: number | null;
@@ -11459,6 +11752,7 @@ export type Database = {
11459
11752
  delivery_date: string | null;
11460
11753
  floriday_sales_order_id: string | null;
11461
11754
  id: string;
11755
+ invoice_due_at: string | null;
11462
11756
  is_reservation: boolean;
11463
11757
  notes: string | null;
11464
11758
  order_date: string;
@@ -11480,6 +11774,7 @@ export type Database = {
11480
11774
  delivery_date?: string | null;
11481
11775
  floriday_sales_order_id?: string | null;
11482
11776
  id?: string;
11777
+ invoice_due_at?: string | null;
11483
11778
  is_reservation?: boolean;
11484
11779
  notes?: string | null;
11485
11780
  order_date?: string;
@@ -11501,6 +11796,7 @@ export type Database = {
11501
11796
  delivery_date?: string | null;
11502
11797
  floriday_sales_order_id?: string | null;
11503
11798
  id?: string;
11799
+ invoice_due_at?: string | null;
11504
11800
  is_reservation?: boolean;
11505
11801
  notes?: string | null;
11506
11802
  order_date?: string;
@@ -12853,6 +13149,9 @@ export type Database = {
12853
13149
  created_at: string;
12854
13150
  id: string;
12855
13151
  laatst_gezien: string;
13152
+ laatste_fout: string | null;
13153
+ laatste_request_id: number | null;
13154
+ mislukte_posts: number;
12856
13155
  tick_sleutel: string;
12857
13156
  updated_at: string;
12858
13157
  };
@@ -12862,6 +13161,9 @@ export type Database = {
12862
13161
  created_at?: string;
12863
13162
  id?: string;
12864
13163
  laatst_gezien?: string;
13164
+ laatste_fout?: string | null;
13165
+ laatste_request_id?: number | null;
13166
+ mislukte_posts?: number;
12865
13167
  tick_sleutel?: string;
12866
13168
  updated_at?: string;
12867
13169
  };
@@ -12871,6 +13173,9 @@ export type Database = {
12871
13173
  created_at?: string;
12872
13174
  id?: string;
12873
13175
  laatst_gezien?: string;
13176
+ laatste_fout?: string | null;
13177
+ laatste_request_id?: number | null;
13178
+ mislukte_posts?: number;
12874
13179
  tick_sleutel?: string;
12875
13180
  updated_at?: string;
12876
13181
  };
@@ -12878,18 +13183,24 @@ export type Database = {
12878
13183
  };
12879
13184
  print_queue_settings: {
12880
13185
  Row: {
13186
+ bewaar_bestanden_dagen: number;
13187
+ bewaar_opdrachten_dagen: number;
12881
13188
  created_at: string;
12882
13189
  dubbel_venster_minuten: number;
12883
13190
  id: string;
12884
13191
  updated_at: string;
12885
13192
  };
12886
13193
  Insert: {
13194
+ bewaar_bestanden_dagen?: number;
13195
+ bewaar_opdrachten_dagen?: number;
12887
13196
  created_at?: string;
12888
13197
  dubbel_venster_minuten?: number;
12889
13198
  id?: string;
12890
13199
  updated_at?: string;
12891
13200
  };
12892
13201
  Update: {
13202
+ bewaar_bestanden_dagen?: number;
13203
+ bewaar_opdrachten_dagen?: number;
12893
13204
  created_at?: string;
12894
13205
  dubbel_venster_minuten?: number;
12895
13206
  id?: string;
@@ -14429,6 +14740,100 @@ export type Database = {
14429
14740
  }
14430
14741
  ];
14431
14742
  };
14743
+ role_assignments: {
14744
+ Row: {
14745
+ created_at: string;
14746
+ id: string;
14747
+ role_id: string;
14748
+ user_id: string;
14749
+ };
14750
+ Insert: {
14751
+ created_at?: string;
14752
+ id?: string;
14753
+ role_id: string;
14754
+ user_id: string;
14755
+ };
14756
+ Update: {
14757
+ created_at?: string;
14758
+ id?: string;
14759
+ role_id?: string;
14760
+ user_id?: string;
14761
+ };
14762
+ Relationships: [
14763
+ {
14764
+ foreignKeyName: "role_assignments_role_id_fkey";
14765
+ columns: ["role_id"];
14766
+ isOneToOne: false;
14767
+ referencedRelation: "roles";
14768
+ referencedColumns: ["id"];
14769
+ }
14770
+ ];
14771
+ };
14772
+ role_permissions: {
14773
+ Row: {
14774
+ can_edit: boolean;
14775
+ can_view: boolean;
14776
+ feature_id: string;
14777
+ id: string;
14778
+ module_id: string;
14779
+ role_id: string;
14780
+ updated_at: string;
14781
+ };
14782
+ Insert: {
14783
+ can_edit?: boolean;
14784
+ can_view?: boolean;
14785
+ feature_id?: string;
14786
+ id?: string;
14787
+ module_id: string;
14788
+ role_id: string;
14789
+ updated_at?: string;
14790
+ };
14791
+ Update: {
14792
+ can_edit?: boolean;
14793
+ can_view?: boolean;
14794
+ feature_id?: string;
14795
+ id?: string;
14796
+ module_id?: string;
14797
+ role_id?: string;
14798
+ updated_at?: string;
14799
+ };
14800
+ Relationships: [
14801
+ {
14802
+ foreignKeyName: "role_permissions_role_id_fkey";
14803
+ columns: ["role_id"];
14804
+ isOneToOne: false;
14805
+ referencedRelation: "roles";
14806
+ referencedColumns: ["id"];
14807
+ }
14808
+ ];
14809
+ };
14810
+ roles: {
14811
+ Row: {
14812
+ created_at: string;
14813
+ id: string;
14814
+ is_protected: boolean;
14815
+ key: string;
14816
+ name: string;
14817
+ updated_at: string;
14818
+ };
14819
+ Insert: {
14820
+ created_at?: string;
14821
+ id?: string;
14822
+ is_protected?: boolean;
14823
+ key: string;
14824
+ name: string;
14825
+ updated_at?: string;
14826
+ };
14827
+ Update: {
14828
+ created_at?: string;
14829
+ id?: string;
14830
+ is_protected?: boolean;
14831
+ key?: string;
14832
+ name?: string;
14833
+ updated_at?: string;
14834
+ };
14835
+ Relationships: [];
14836
+ };
14432
14837
  rooms: {
14433
14838
  Row: {
14434
14839
  capacity: number;
@@ -15109,6 +15514,56 @@ export type Database = {
15109
15514
  };
15110
15515
  Relationships: [];
15111
15516
  };
15517
+ time_compensation_entries: {
15518
+ Row: {
15519
+ created_at: string;
15520
+ employee_id: string;
15521
+ entry_date: string;
15522
+ id: string;
15523
+ km: number;
15524
+ meal_allowance: number;
15525
+ notes: string | null;
15526
+ standby_evening: number;
15527
+ standby_weekend: number;
15528
+ tvt_change: number;
15529
+ updated_at: string;
15530
+ };
15531
+ Insert: {
15532
+ created_at?: string;
15533
+ employee_id: string;
15534
+ entry_date: string;
15535
+ id?: string;
15536
+ km?: number;
15537
+ meal_allowance?: number;
15538
+ notes?: string | null;
15539
+ standby_evening?: number;
15540
+ standby_weekend?: number;
15541
+ tvt_change?: number;
15542
+ updated_at?: string;
15543
+ };
15544
+ Update: {
15545
+ created_at?: string;
15546
+ employee_id?: string;
15547
+ entry_date?: string;
15548
+ id?: string;
15549
+ km?: number;
15550
+ meal_allowance?: number;
15551
+ notes?: string | null;
15552
+ standby_evening?: number;
15553
+ standby_weekend?: number;
15554
+ tvt_change?: number;
15555
+ updated_at?: string;
15556
+ };
15557
+ Relationships: [
15558
+ {
15559
+ foreignKeyName: "time_compensation_entries_employee_id_fkey";
15560
+ columns: ["employee_id"];
15561
+ isOneToOne: false;
15562
+ referencedRelation: "profiles";
15563
+ referencedColumns: ["id"];
15564
+ }
15565
+ ];
15566
+ };
15112
15567
  time_entries: {
15113
15568
  Row: {
15114
15569
  created_at: string;
@@ -15143,68 +15598,174 @@ export type Database = {
15143
15598
  undertime?: number;
15144
15599
  updated_at?: string;
15145
15600
  };
15601
+ Relationships: [];
15602
+ };
15603
+ time_log_week_approvals: {
15604
+ Row: {
15605
+ approved_at: string | null;
15606
+ approved_by: string | null;
15607
+ created_at: string;
15608
+ employee_id: string;
15609
+ id: string;
15610
+ locked: boolean;
15611
+ notes: string | null;
15612
+ status: string;
15613
+ submitted_at: string | null;
15614
+ updated_at: string;
15615
+ week_start: string;
15616
+ };
15617
+ Insert: {
15618
+ approved_at?: string | null;
15619
+ approved_by?: string | null;
15620
+ created_at?: string;
15621
+ employee_id: string;
15622
+ id?: string;
15623
+ locked?: boolean;
15624
+ notes?: string | null;
15625
+ status?: string;
15626
+ submitted_at?: string | null;
15627
+ updated_at?: string;
15628
+ week_start: string;
15629
+ };
15630
+ Update: {
15631
+ approved_at?: string | null;
15632
+ approved_by?: string | null;
15633
+ created_at?: string;
15634
+ employee_id?: string;
15635
+ id?: string;
15636
+ locked?: boolean;
15637
+ notes?: string | null;
15638
+ status?: string;
15639
+ submitted_at?: string | null;
15640
+ updated_at?: string;
15641
+ week_start?: string;
15642
+ };
15146
15643
  Relationships: [
15147
15644
  {
15148
- foreignKeyName: "time_entries_employee_id_fkey";
15645
+ foreignKeyName: "time_log_week_approvals_employee_id_fkey";
15149
15646
  columns: ["employee_id"];
15150
15647
  isOneToOne: false;
15151
- referencedRelation: "monteurs";
15648
+ referencedRelation: "profiles";
15152
15649
  referencedColumns: ["id"];
15153
15650
  }
15154
15651
  ];
15155
15652
  };
15156
15653
  time_logs: {
15157
15654
  Row: {
15655
+ auto_stop_reason: string | null;
15656
+ auto_stopped: boolean;
15158
15657
  created_at: string;
15658
+ current_latitude: number | null;
15659
+ current_longitude: number | null;
15660
+ current_position_updated_at: string | null;
15159
15661
  employee_id: string;
15662
+ end_latitude: number | null;
15663
+ end_longitude: number | null;
15160
15664
  end_time: string | null;
15665
+ eta_distance_km: number | null;
15666
+ eta_minutes: number | null;
15667
+ eta_updated_at: string | null;
15668
+ hour_category: string | null;
15161
15669
  id: string;
15670
+ last_reminder_at: string | null;
15162
15671
  notes: string | null;
15163
15672
  overtime_hours: number;
15164
15673
  overtime_type: string | null;
15165
15674
  regular_hours: number;
15675
+ reminder_count: number;
15676
+ requires_review: boolean;
15677
+ start_latitude: number | null;
15678
+ start_longitude: number | null;
15166
15679
  start_time: string;
15167
15680
  travel_cost: number | null;
15168
15681
  travel_distance_km: number | null;
15682
+ travel_duration_min: number | null;
15683
+ travel_time_minutes: number | null;
15169
15684
  type: string;
15170
15685
  updated_at: string;
15686
+ work_order_id: string | null;
15171
15687
  };
15172
15688
  Insert: {
15689
+ auto_stop_reason?: string | null;
15690
+ auto_stopped?: boolean;
15173
15691
  created_at?: string;
15692
+ current_latitude?: number | null;
15693
+ current_longitude?: number | null;
15694
+ current_position_updated_at?: string | null;
15174
15695
  employee_id: string;
15696
+ end_latitude?: number | null;
15697
+ end_longitude?: number | null;
15175
15698
  end_time?: string | null;
15699
+ eta_distance_km?: number | null;
15700
+ eta_minutes?: number | null;
15701
+ eta_updated_at?: string | null;
15702
+ hour_category?: string | null;
15176
15703
  id?: string;
15704
+ last_reminder_at?: string | null;
15177
15705
  notes?: string | null;
15178
15706
  overtime_hours?: number;
15179
15707
  overtime_type?: string | null;
15180
15708
  regular_hours?: number;
15709
+ reminder_count?: number;
15710
+ requires_review?: boolean;
15711
+ start_latitude?: number | null;
15712
+ start_longitude?: number | null;
15181
15713
  start_time?: string;
15182
15714
  travel_cost?: number | null;
15183
15715
  travel_distance_km?: number | null;
15716
+ travel_duration_min?: number | null;
15717
+ travel_time_minutes?: number | null;
15184
15718
  type: string;
15185
15719
  updated_at?: string;
15720
+ work_order_id?: string | null;
15186
15721
  };
15187
15722
  Update: {
15723
+ auto_stop_reason?: string | null;
15724
+ auto_stopped?: boolean;
15188
15725
  created_at?: string;
15726
+ current_latitude?: number | null;
15727
+ current_longitude?: number | null;
15728
+ current_position_updated_at?: string | null;
15189
15729
  employee_id?: string;
15730
+ end_latitude?: number | null;
15731
+ end_longitude?: number | null;
15190
15732
  end_time?: string | null;
15733
+ eta_distance_km?: number | null;
15734
+ eta_minutes?: number | null;
15735
+ eta_updated_at?: string | null;
15736
+ hour_category?: string | null;
15191
15737
  id?: string;
15738
+ last_reminder_at?: string | null;
15192
15739
  notes?: string | null;
15193
15740
  overtime_hours?: number;
15194
15741
  overtime_type?: string | null;
15195
15742
  regular_hours?: number;
15743
+ reminder_count?: number;
15744
+ requires_review?: boolean;
15745
+ start_latitude?: number | null;
15746
+ start_longitude?: number | null;
15196
15747
  start_time?: string;
15197
15748
  travel_cost?: number | null;
15198
15749
  travel_distance_km?: number | null;
15750
+ travel_duration_min?: number | null;
15751
+ travel_time_minutes?: number | null;
15199
15752
  type?: string;
15200
15753
  updated_at?: string;
15754
+ work_order_id?: string | null;
15201
15755
  };
15202
15756
  Relationships: [
15203
15757
  {
15204
15758
  foreignKeyName: "time_logs_employee_id_fkey";
15205
15759
  columns: ["employee_id"];
15206
15760
  isOneToOne: false;
15207
- referencedRelation: "monteurs";
15761
+ referencedRelation: "profiles";
15762
+ referencedColumns: ["id"];
15763
+ },
15764
+ {
15765
+ foreignKeyName: "time_logs_work_order_id_fkey";
15766
+ columns: ["work_order_id"];
15767
+ isOneToOne: false;
15768
+ referencedRelation: "work_orders";
15208
15769
  referencedColumns: ["id"];
15209
15770
  }
15210
15771
  ];
@@ -15245,7 +15806,7 @@ export type Database = {
15245
15806
  foreignKeyName: "time_off_entries_employee_id_fkey";
15246
15807
  columns: ["employee_id"];
15247
15808
  isOneToOne: false;
15248
- referencedRelation: "monteurs";
15809
+ referencedRelation: "profiles";
15249
15810
  referencedColumns: ["id"];
15250
15811
  }
15251
15812
  ];
@@ -15558,6 +16119,39 @@ export type Database = {
15558
16119
  };
15559
16120
  Relationships: [];
15560
16121
  };
16122
+ twinfield_cron_locks: {
16123
+ Row: {
16124
+ created_at: string;
16125
+ heartbeat_at: string;
16126
+ job_name: string;
16127
+ last_error: string | null;
16128
+ last_finished_at: string | null;
16129
+ locked_at: string;
16130
+ run_id: string;
16131
+ updated_at: string;
16132
+ };
16133
+ Insert: {
16134
+ created_at?: string;
16135
+ heartbeat_at?: string;
16136
+ job_name: string;
16137
+ last_error?: string | null;
16138
+ last_finished_at?: string | null;
16139
+ locked_at?: string;
16140
+ run_id?: string;
16141
+ updated_at?: string;
16142
+ };
16143
+ Update: {
16144
+ created_at?: string;
16145
+ heartbeat_at?: string;
16146
+ job_name?: string;
16147
+ last_error?: string | null;
16148
+ last_finished_at?: string | null;
16149
+ locked_at?: string;
16150
+ run_id?: string;
16151
+ updated_at?: string;
16152
+ };
16153
+ Relationships: [];
16154
+ };
15561
16155
  twinfield_customers: {
15562
16156
  Row: {
15563
16157
  address: string | null;
@@ -15820,6 +16414,8 @@ export type Database = {
15820
16414
  };
15821
16415
  twinfield_invoice_settings: {
15822
16416
  Row: {
16417
+ auto_invoice_enabled: boolean;
16418
+ auto_invoice_trigger_statuses: string[];
15823
16419
  created_at: string;
15824
16420
  debtor_gl_account: string;
15825
16421
  default_credit_invoice_type: string | null;
@@ -15840,6 +16436,8 @@ export type Database = {
15840
16436
  vat_code_export: string | null;
15841
16437
  };
15842
16438
  Insert: {
16439
+ auto_invoice_enabled?: boolean;
16440
+ auto_invoice_trigger_statuses?: string[];
15843
16441
  created_at?: string;
15844
16442
  debtor_gl_account?: string;
15845
16443
  default_credit_invoice_type?: string | null;
@@ -15860,6 +16458,8 @@ export type Database = {
15860
16458
  vat_code_export?: string | null;
15861
16459
  };
15862
16460
  Update: {
16461
+ auto_invoice_enabled?: boolean;
16462
+ auto_invoice_trigger_statuses?: string[];
15863
16463
  created_at?: string;
15864
16464
  debtor_gl_account?: string;
15865
16465
  default_credit_invoice_type?: string | null;
@@ -16162,6 +16762,7 @@ export type Database = {
16162
16762
  twinfield_push_queue: {
16163
16763
  Row: {
16164
16764
  action: string;
16765
+ attempt_started_at: string | null;
16165
16766
  attempts: number;
16166
16767
  connection_id: string | null;
16167
16768
  created_at: string;
@@ -16178,6 +16779,7 @@ export type Database = {
16178
16779
  };
16179
16780
  Insert: {
16180
16781
  action?: string;
16782
+ attempt_started_at?: string | null;
16181
16783
  attempts?: number;
16182
16784
  connection_id?: string | null;
16183
16785
  created_at?: string;
@@ -16194,6 +16796,7 @@ export type Database = {
16194
16796
  };
16195
16797
  Update: {
16196
16798
  action?: string;
16799
+ attempt_started_at?: string | null;
16197
16800
  attempts?: number;
16198
16801
  connection_id?: string | null;
16199
16802
  created_at?: string;
@@ -16396,15 +16999,7 @@ export type Database = {
16396
16999
  workday_end?: string | null;
16397
17000
  workday_start?: string | null;
16398
17001
  };
16399
- Relationships: [
16400
- {
16401
- foreignKeyName: "uren_cao_profiles_monteur_id_fkey";
16402
- columns: ["monteur_id"];
16403
- isOneToOne: true;
16404
- referencedRelation: "monteurs";
16405
- referencedColumns: ["id"];
16406
- }
16407
- ];
17002
+ Relationships: [];
16408
17003
  };
16409
17004
  uren_entries: {
16410
17005
  Row: {
@@ -16450,13 +17045,6 @@ export type Database = {
16450
17045
  werkbon_id?: string | null;
16451
17046
  };
16452
17047
  Relationships: [
16453
- {
16454
- foreignKeyName: "uren_entries_monteur_id_fkey";
16455
- columns: ["monteur_id"];
16456
- isOneToOne: false;
16457
- referencedRelation: "monteurs";
16458
- referencedColumns: ["id"];
16459
- },
16460
17048
  {
16461
17049
  foreignKeyName: "uren_entries_werkbon_id_fkey";
16462
17050
  columns: ["werkbon_id"];
@@ -16938,19 +17526,12 @@ export type Database = {
16938
17526
  submitted_at?: string | null;
16939
17527
  updated_at?: string;
16940
17528
  };
16941
- Relationships: [
16942
- {
16943
- foreignKeyName: "uren_weekstaten_monteur_id_fkey";
16944
- columns: ["monteur_id"];
16945
- isOneToOne: false;
16946
- referencedRelation: "monteurs";
16947
- referencedColumns: ["id"];
16948
- }
16949
- ];
17529
+ Relationships: [];
16950
17530
  };
16951
17531
  user_module_permissions: {
16952
17532
  Row: {
16953
17533
  created_at: string;
17534
+ feature_id: string;
16954
17535
  id: string;
16955
17536
  module_id: string;
16956
17537
  permission: string;
@@ -16959,6 +17540,7 @@ export type Database = {
16959
17540
  };
16960
17541
  Insert: {
16961
17542
  created_at?: string;
17543
+ feature_id?: string;
16962
17544
  id?: string;
16963
17545
  module_id: string;
16964
17546
  permission: string;
@@ -16967,6 +17549,7 @@ export type Database = {
16967
17549
  };
16968
17550
  Update: {
16969
17551
  created_at?: string;
17552
+ feature_id?: string;
16970
17553
  id?: string;
16971
17554
  module_id?: string;
16972
17555
  permission?: string;
@@ -17004,6 +17587,53 @@ export type Database = {
17004
17587
  }
17005
17588
  ];
17006
17589
  };
17590
+ van_inventories: {
17591
+ Row: {
17592
+ barcode: string | null;
17593
+ created_at: string;
17594
+ id: string;
17595
+ monteur_id: string | null;
17596
+ price_per_unit: number;
17597
+ product_name: string;
17598
+ quantity_current: number;
17599
+ quantity_min: number;
17600
+ unit: string;
17601
+ updated_at: string;
17602
+ };
17603
+ Insert: {
17604
+ barcode?: string | null;
17605
+ created_at?: string;
17606
+ id?: string;
17607
+ monteur_id?: string | null;
17608
+ price_per_unit?: number;
17609
+ product_name: string;
17610
+ quantity_current?: number;
17611
+ quantity_min?: number;
17612
+ unit?: string;
17613
+ updated_at?: string;
17614
+ };
17615
+ Update: {
17616
+ barcode?: string | null;
17617
+ created_at?: string;
17618
+ id?: string;
17619
+ monteur_id?: string | null;
17620
+ price_per_unit?: number;
17621
+ product_name?: string;
17622
+ quantity_current?: number;
17623
+ quantity_min?: number;
17624
+ unit?: string;
17625
+ updated_at?: string;
17626
+ };
17627
+ Relationships: [
17628
+ {
17629
+ foreignKeyName: "van_inventories_monteur_id_fkey";
17630
+ columns: ["monteur_id"];
17631
+ isOneToOne: false;
17632
+ referencedRelation: "profiles";
17633
+ referencedColumns: ["id"];
17634
+ }
17635
+ ];
17636
+ };
17007
17637
  voorraad_custom_fields: {
17008
17638
  Row: {
17009
17639
  created_at: string;
@@ -17977,7 +18607,7 @@ export type Database = {
17977
18607
  foreignKeyName: "work_order_monteurs_monteur_id_fkey";
17978
18608
  columns: ["monteur_id"];
17979
18609
  isOneToOne: false;
17980
- referencedRelation: "monteurs";
18610
+ referencedRelation: "profiles";
17981
18611
  referencedColumns: ["id"];
17982
18612
  },
17983
18613
  {
@@ -17989,6 +18619,63 @@ export type Database = {
17989
18619
  }
17990
18620
  ];
17991
18621
  };
18622
+ work_order_photos: {
18623
+ Row: {
18624
+ ai_caption: string | null;
18625
+ ai_categorized_at: string | null;
18626
+ ai_labels: Json | null;
18627
+ caption: string | null;
18628
+ created_at: string;
18629
+ id: string;
18630
+ monteur_id: string | null;
18631
+ photo_type: string;
18632
+ storage_path: string;
18633
+ updated_at: string;
18634
+ work_order_id: string;
18635
+ };
18636
+ Insert: {
18637
+ ai_caption?: string | null;
18638
+ ai_categorized_at?: string | null;
18639
+ ai_labels?: Json | null;
18640
+ caption?: string | null;
18641
+ created_at?: string;
18642
+ id?: string;
18643
+ monteur_id?: string | null;
18644
+ photo_type?: string;
18645
+ storage_path: string;
18646
+ updated_at?: string;
18647
+ work_order_id: string;
18648
+ };
18649
+ Update: {
18650
+ ai_caption?: string | null;
18651
+ ai_categorized_at?: string | null;
18652
+ ai_labels?: Json | null;
18653
+ caption?: string | null;
18654
+ created_at?: string;
18655
+ id?: string;
18656
+ monteur_id?: string | null;
18657
+ photo_type?: string;
18658
+ storage_path?: string;
18659
+ updated_at?: string;
18660
+ work_order_id?: string;
18661
+ };
18662
+ Relationships: [
18663
+ {
18664
+ foreignKeyName: "work_order_photos_monteur_id_fkey";
18665
+ columns: ["monteur_id"];
18666
+ isOneToOne: false;
18667
+ referencedRelation: "profiles";
18668
+ referencedColumns: ["id"];
18669
+ },
18670
+ {
18671
+ foreignKeyName: "work_order_photos_work_order_id_fkey";
18672
+ columns: ["work_order_id"];
18673
+ isOneToOne: false;
18674
+ referencedRelation: "work_orders";
18675
+ referencedColumns: ["id"];
18676
+ }
18677
+ ];
18678
+ };
17992
18679
  work_orders: {
17993
18680
  Row: {
17994
18681
  assigned_to: string | null;
@@ -18020,7 +18707,6 @@ export type Database = {
18020
18707
  scheduled_end_time: string | null;
18021
18708
  scheduled_start_time: string | null;
18022
18709
  status: string;
18023
- tenant_id: string;
18024
18710
  total_hours_worked: number | null;
18025
18711
  total_price: number | null;
18026
18712
  travel_time_minutes: number | null;
@@ -18058,7 +18744,6 @@ export type Database = {
18058
18744
  scheduled_end_time?: string | null;
18059
18745
  scheduled_start_time?: string | null;
18060
18746
  status?: string;
18061
- tenant_id: string;
18062
18747
  total_hours_worked?: number | null;
18063
18748
  total_price?: number | null;
18064
18749
  travel_time_minutes?: number | null;
@@ -18096,7 +18781,6 @@ export type Database = {
18096
18781
  scheduled_end_time?: string | null;
18097
18782
  scheduled_start_time?: string | null;
18098
18783
  status?: string;
18099
- tenant_id?: string;
18100
18784
  total_hours_worked?: number | null;
18101
18785
  total_price?: number | null;
18102
18786
  travel_time_minutes?: number | null;
@@ -18111,13 +18795,6 @@ export type Database = {
18111
18795
  isOneToOne: false;
18112
18796
  referencedRelation: "work_orders";
18113
18797
  referencedColumns: ["id"];
18114
- },
18115
- {
18116
- foreignKeyName: "work_orders_tenant_id_fkey";
18117
- columns: ["tenant_id"];
18118
- isOneToOne: false;
18119
- referencedRelation: "tenants";
18120
- referencedColumns: ["id"];
18121
18798
  }
18122
18799
  ];
18123
18800
  };
@@ -18815,6 +19492,19 @@ export type Database = {
18815
19492
  };
18816
19493
  Returns: undefined;
18817
19494
  };
19495
+ approve_mailbox_order_proposal: {
19496
+ Args: {
19497
+ p_custom_fields: Json;
19498
+ p_customer_id: string;
19499
+ p_delivery_date: string;
19500
+ p_field_values?: Json;
19501
+ p_lines: Json;
19502
+ p_notes: string;
19503
+ p_proposal_id: string;
19504
+ p_reviewed_by: string;
19505
+ };
19506
+ Returns: Json;
19507
+ };
18818
19508
  assign_cart_numbers: {
18819
19509
  Args: {
18820
19510
  p_carts: Json;
@@ -18850,6 +19540,10 @@ export type Database = {
18850
19540
  processed_items: number;
18851
19541
  }[];
18852
19542
  };
19543
+ backfill_order_auto_invoice_queue: {
19544
+ Args: never;
19545
+ Returns: number;
19546
+ };
18853
19547
  calculate_layer_stock: {
18854
19548
  Args: {
18855
19549
  p_product_id: string;
@@ -18862,6 +19556,10 @@ export type Database = {
18862
19556
  };
18863
19557
  Returns: number;
18864
19558
  };
19559
+ can_manage_hours: {
19560
+ Args: never;
19561
+ Returns: boolean;
19562
+ };
18865
19563
  check_offer_product_available_stock: {
18866
19564
  Args: {
18867
19565
  p_campaign_product_id: string;
@@ -19051,6 +19749,7 @@ export type Database = {
19051
19749
  };
19052
19750
  Returns: {
19053
19751
  action: string;
19752
+ attempt_started_at: string | null;
19054
19753
  attempts: number;
19055
19754
  connection_id: string | null;
19056
19755
  created_at: string;
@@ -19080,6 +19779,10 @@ export type Database = {
19080
19779
  Args: never;
19081
19780
  Returns: undefined;
19082
19781
  };
19782
+ cleanup_voorraad_module_history: {
19783
+ Args: never;
19784
+ Returns: undefined;
19785
+ };
19083
19786
  complete_floriday_stock_queue: {
19084
19787
  Args: {
19085
19788
  p_attempt_id?: string;
@@ -19134,6 +19837,30 @@ export type Database = {
19134
19837
  agent_naam: string;
19135
19838
  }[];
19136
19839
  };
19840
+ consume_van_inventory: {
19841
+ Args: {
19842
+ p_inventory_id: string;
19843
+ p_quantity: number;
19844
+ };
19845
+ Returns: {
19846
+ barcode: string | null;
19847
+ created_at: string;
19848
+ id: string;
19849
+ monteur_id: string | null;
19850
+ price_per_unit: number;
19851
+ product_name: string;
19852
+ quantity_current: number;
19853
+ quantity_min: number;
19854
+ unit: string;
19855
+ updated_at: string;
19856
+ };
19857
+ SetofOptions: {
19858
+ from: "*";
19859
+ to: "van_inventories";
19860
+ isOneToOne: true;
19861
+ isSetofReturn: false;
19862
+ };
19863
+ };
19137
19864
  control_get_todays_carts: {
19138
19865
  Args: never;
19139
19866
  Returns: {
@@ -19207,6 +19934,13 @@ export type Database = {
19207
19934
  _user_id: string;
19208
19935
  };
19209
19936
  Returns: string;
19937
+ } | {
19938
+ Args: {
19939
+ _feature_id: string;
19940
+ _module_id: string;
19941
+ _user_id: string;
19942
+ };
19943
+ Returns: string;
19210
19944
  };
19211
19945
  email_auth_decrypt: {
19212
19946
  Args: {
@@ -19558,12 +20292,6 @@ export type Database = {
19558
20292
  Args: never;
19559
20293
  Returns: string;
19560
20294
  };
19561
- get_work_order_tenant_id: {
19562
- Args: {
19563
- wo_id: string;
19564
- };
19565
- Returns: string;
19566
- };
19567
20295
  has_module_permission: {
19568
20296
  Args: {
19569
20297
  _min: string;
@@ -19597,6 +20325,13 @@ export type Database = {
19597
20325
  };
19598
20326
  Returns: boolean;
19599
20327
  };
20328
+ is_time_log_week_locked: {
20329
+ Args: {
20330
+ p_employee_id: string;
20331
+ p_start_time: string;
20332
+ };
20333
+ Returns: boolean;
20334
+ };
19600
20335
  is_user_admin: {
19601
20336
  Args: never;
19602
20337
  Returns: boolean;
@@ -19611,13 +20346,14 @@ export type Database = {
19611
20346
  };
19612
20347
  Returns: boolean;
19613
20348
  };
19614
- list_monteurs: {
20349
+ list_medewerkers: {
19615
20350
  Args: never;
19616
20351
  Returns: {
19617
20352
  avatar_url: string;
19618
20353
  display_name: string;
19619
20354
  email: string;
19620
20355
  id: string;
20356
+ roles: string[];
19621
20357
  }[];
19622
20358
  };
19623
20359
  list_my_planning_items: {
@@ -20108,6 +20844,65 @@ export type Database = {
20108
20844
  };
20109
20845
  Returns: number;
20110
20846
  };
20847
+ logistics_plan_claim: {
20848
+ Args: {
20849
+ p_limit?: number;
20850
+ };
20851
+ Returns: {
20852
+ attempts: number;
20853
+ id: string;
20854
+ order_id: string;
20855
+ }[];
20856
+ };
20857
+ logistics_plan_enqueue: {
20858
+ Args: {
20859
+ p_order_id: string;
20860
+ p_reason?: string;
20861
+ };
20862
+ Returns: undefined;
20863
+ };
20864
+ logistics_plan_ensure_event: {
20865
+ Args: {
20866
+ p_order_id: string;
20867
+ };
20868
+ Returns: boolean;
20869
+ };
20870
+ logistics_plan_finish: {
20871
+ Args: {
20872
+ p_error?: string;
20873
+ p_id: string;
20874
+ };
20875
+ Returns: undefined;
20876
+ };
20877
+ logistics_plan_impact_orders: {
20878
+ Args: {
20879
+ p_order_id: string;
20880
+ };
20881
+ Returns: {
20882
+ buffer_id: string;
20883
+ order_id: string;
20884
+ plan_date: string;
20885
+ }[];
20886
+ };
20887
+ logistics_plan_kick: {
20888
+ Args: never;
20889
+ Returns: undefined;
20890
+ };
20891
+ logistics_plan_prune: {
20892
+ Args: never;
20893
+ Returns: number;
20894
+ };
20895
+ logistics_plan_release_stale: {
20896
+ Args: never;
20897
+ Returns: number;
20898
+ };
20899
+ logistics_plan_setting: {
20900
+ Args: {
20901
+ p_default: number;
20902
+ p_key: string;
20903
+ };
20904
+ Returns: number;
20905
+ };
20111
20906
  logistics_queue_capacity_email: {
20112
20907
  Args: {
20113
20908
  p_alert_id: string;
@@ -20349,6 +21144,7 @@ export type Database = {
20349
21144
  my_module_permissions: {
20350
21145
  Args: never;
20351
21146
  Returns: {
21147
+ feature_id: string;
20352
21148
  module_id: string;
20353
21149
  permission: string;
20354
21150
  }[];
@@ -20403,6 +21199,13 @@ export type Database = {
20403
21199
  };
20404
21200
  Returns: boolean;
20405
21201
  };
21202
+ opruim_print_historie: {
21203
+ Args: never;
21204
+ Returns: {
21205
+ ontdaan: number;
21206
+ verwijderd: number;
21207
+ }[];
21208
+ };
20406
21209
  order_number_prefix: {
20407
21210
  Args: {
20408
21211
  p_custom_fields?: Json;
@@ -20797,6 +21600,12 @@ export type Database = {
20797
21600
  };
20798
21601
  Returns: undefined;
20799
21602
  };
21603
+ reset_stalled_floriday_stock_queue: {
21604
+ Args: {
21605
+ p_include_failed?: boolean;
21606
+ };
21607
+ Returns: number;
21608
+ };
20800
21609
  resolve_group_allocation: {
20801
21610
  Args: {
20802
21611
  _needed: number;
@@ -20851,6 +21660,10 @@ export type Database = {
20851
21660
  Args: never;
20852
21661
  Returns: undefined;
20853
21662
  };
21663
+ run_floriday_stock_queue_process: {
21664
+ Args: never;
21665
+ Returns: undefined;
21666
+ };
20854
21667
  run_logistics_tasks_dispatch: {
20855
21668
  Args: never;
20856
21669
  Returns: undefined;
@@ -21212,6 +22025,16 @@ export type Database = {
21212
22025
  };
21213
22026
  Returns: string[];
21214
22027
  };
22028
+ switch_time_log: {
22029
+ Args: {
22030
+ p_employee_id: string;
22031
+ p_start_lat?: number;
22032
+ p_start_lng?: number;
22033
+ p_type: string;
22034
+ p_work_order_id?: string;
22035
+ };
22036
+ Returns: Json;
22037
+ };
21215
22038
  sync_all_layer_stocks: {
21216
22039
  Args: never;
21217
22040
  Returns: undefined;
@@ -21246,6 +22069,15 @@ export type Database = {
21246
22069
  };
21247
22070
  Returns: undefined;
21248
22071
  };
22072
+ trade_item_stock_duplicates: {
22073
+ Args: never;
22074
+ Returns: {
22075
+ keys: string[];
22076
+ product_id: string;
22077
+ product_name: string;
22078
+ row_count: number;
22079
+ }[];
22080
+ };
21249
22081
  try_debtor_lock: {
21250
22082
  Args: {
21251
22083
  _group_key: string;
@@ -21253,6 +22085,24 @@ export type Database = {
21253
22085
  };
21254
22086
  Returns: boolean;
21255
22087
  };
22088
+ twinfield_cron_lock_acquire: {
22089
+ Args: {
22090
+ _job_name: string;
22091
+ _stale_seconds?: number;
22092
+ };
22093
+ Returns: boolean;
22094
+ };
22095
+ twinfield_cron_lock_release: {
22096
+ Args: {
22097
+ _error?: string;
22098
+ _job_name: string;
22099
+ };
22100
+ Returns: undefined;
22101
+ };
22102
+ twinfield_prune_push_queue: {
22103
+ Args: never;
22104
+ Returns: number;
22105
+ };
21256
22106
  twinfield_register_cron: {
21257
22107
  Args: {
21258
22108
  apikey?: string;