@flowselections/layout-maker 1.7.2 → 1.7.3

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 (95) hide show
  1. package/README.md +69 -54
  2. package/dist-lib/components/AfdrukKnop.d.ts +1 -1
  3. package/dist-lib/components/AfdrukKnop.js +2 -2
  4. package/dist-lib/components/AiLayoutImportDialog.js +4 -4
  5. package/dist-lib/components/BlokOntwerperPage.js +5 -5
  6. package/dist-lib/components/ComputersLijst.js +2 -2
  7. package/dist-lib/components/DocumentSettingsPanel.d.ts +2 -2
  8. package/dist-lib/components/DocumentSettingsPanel.js +3 -3
  9. package/dist-lib/components/FormaatOrientatieBar.d.ts +1 -1
  10. package/dist-lib/components/FormaatOrientatieBar.js +2 -2
  11. package/dist-lib/components/LayoutsPage.js +4 -4
  12. package/dist-lib/components/LogoBibliotheekDialog.d.ts +1 -1
  13. package/dist-lib/components/LogoBibliotheekDialog.js +2 -2
  14. package/dist-lib/components/LogosPage.d.ts +1 -1
  15. package/dist-lib/components/LogosPage.js +2 -2
  16. package/dist-lib/components/NetwerkPrintersDialog.js +2 -2
  17. package/dist-lib/components/PakbonBuilderPage.js +8 -8
  18. package/dist-lib/components/PakbonPreview.d.ts +1 -1
  19. package/dist-lib/components/PakbonPreview.js +3 -3
  20. package/dist-lib/components/PakbonSectiesPanel.d.ts +1 -1
  21. package/dist-lib/components/PakbonSectiesPanel.js +4 -4
  22. package/dist-lib/components/PrintQueuePage.d.ts.map +1 -1
  23. package/dist-lib/components/PrintQueuePage.js +7 -6
  24. package/dist-lib/components/PrinterSetupWizard.js +6 -6
  25. package/dist-lib/components/PrintersPage.js +7 -7
  26. package/dist-lib/components/ProductiebonBlokkenPanel.d.ts +1 -1
  27. package/dist-lib/components/ProductiebonBlokkenPanel.js +1 -1
  28. package/dist-lib/components/ProductiebonBuilderPage.js +6 -6
  29. package/dist-lib/components/ProductiebonPreview.d.ts +1 -1
  30. package/dist-lib/components/ProductiebonPreview.js +2 -2
  31. package/dist-lib/components/WerkplekConfiguratiePage.js +7 -7
  32. package/dist-lib/index.d.ts +62 -46
  33. package/dist-lib/index.d.ts.map +1 -1
  34. package/dist-lib/index.js +46 -46
  35. package/dist-lib/integrations/supabase/auth-attacher.js +1 -1
  36. package/dist-lib/integrations/supabase/auth-middleware.d.ts +1302 -749
  37. package/dist-lib/integrations/supabase/auth-middleware.d.ts.map +1 -1
  38. package/dist-lib/integrations/supabase/client.d.ts +1 -1
  39. package/dist-lib/integrations/supabase/client.js +1 -1
  40. package/dist-lib/integrations/supabase/client.server.d.ts +1302 -749
  41. package/dist-lib/integrations/supabase/client.server.d.ts.map +1 -1
  42. package/dist-lib/integrations/supabase/client.server.js +1 -1
  43. package/dist-lib/integrations/supabase/types.d.ts +685 -127
  44. package/dist-lib/integrations/supabase/types.d.ts.map +1 -1
  45. package/dist-lib/lib/aiLayout.functions.d.ts +1385 -832
  46. package/dist-lib/lib/aiLayout.functions.d.ts.map +1 -1
  47. package/dist-lib/lib/aiLayout.functions.js +2 -2
  48. package/dist-lib/lib/aiLayout.server.d.ts +1 -1
  49. package/dist-lib/lib/aiLayout.server.js +9 -9
  50. package/dist-lib/lib/browserPrint.d.ts +1 -1
  51. package/dist-lib/lib/browserPrint.js +8 -8
  52. package/dist-lib/lib/directPrint.d.ts +1 -1
  53. package/dist-lib/lib/directPrint.js +4 -4
  54. package/dist-lib/lib/documentPdf.d.ts +1 -1
  55. package/dist-lib/lib/documentProfiles.d.ts +1 -1
  56. package/dist-lib/lib/formaatPrinters.js +1 -1
  57. package/dist-lib/lib/htmlNaarPdf.server.js +1 -1
  58. package/dist-lib/lib/layoutPreview.d.ts +1 -1
  59. package/dist-lib/lib/layoutPreview.js +8 -8
  60. package/dist-lib/lib/logoLibrary.js +1 -1
  61. package/dist-lib/lib/orderData.server.d.ts +2 -1
  62. package/dist-lib/lib/orderData.server.d.ts.map +1 -1
  63. package/dist-lib/lib/orderData.server.js +7 -8
  64. package/dist-lib/lib/pakbonBuilder.d.ts +1 -1
  65. package/dist-lib/lib/pakbonHtml.d.ts +1 -1
  66. package/dist-lib/lib/pakbonHtml.js +52 -52
  67. package/dist-lib/lib/printApi.d.ts +1 -1
  68. package/dist-lib/lib/printApi.js +3 -3
  69. package/dist-lib/lib/printQueue.server.d.ts +12 -3
  70. package/dist-lib/lib/printQueue.server.d.ts.map +1 -1
  71. package/dist-lib/lib/printQueue.server.js +66 -48
  72. package/dist-lib/lib/printService.functions.d.ts +5539 -24425
  73. package/dist-lib/lib/printService.functions.d.ts.map +1 -1
  74. package/dist-lib/lib/printService.functions.js +5 -31
  75. package/dist-lib/lib/printService.server.js +1 -1
  76. package/dist-lib/lib/productiebonBuilder.d.ts +1 -1
  77. package/dist-lib/lib/productiebonHtml.js +17 -17
  78. package/dist-lib/lib/profielHtml.js +20 -20
  79. package/dist-lib/lib/queueTick.d.ts +11 -3
  80. package/dist-lib/lib/queueTick.d.ts.map +1 -1
  81. package/dist-lib/lib/queueTick.js +68 -21
  82. package/dist-lib/lib/queueTickClient.d.ts +8 -0
  83. package/dist-lib/lib/queueTickClient.d.ts.map +1 -0
  84. package/dist-lib/lib/queueTickClient.js +37 -0
  85. package/dist-lib/lib/runnerRegistry.server.d.ts +3 -2
  86. package/dist-lib/lib/runnerRegistry.server.d.ts.map +1 -1
  87. package/dist-lib/lib/runnerRegistry.server.js +6 -8
  88. package/dist-lib/lib/supabaseAdmin.server.d.ts +5 -5
  89. package/dist-lib/lib/supabaseAdmin.server.js +43 -43
  90. package/dist-lib/lib/supabaseClient.d.ts +1 -1
  91. package/dist-lib/lib/testpagina.js +3 -3
  92. package/dist-lib/lib/useDocumentData.d.ts +1 -1
  93. package/dist-lib/lib/useDocumentData.js +1 -1
  94. package/dist-lib/lib/useNetwerkPrinters.js +1 -1
  95. package/package.json +2 -2
@@ -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;
@@ -7975,7 +8095,6 @@ export type Database = {
7975
8095
  start_date: string;
7976
8096
  start_time: string | null;
7977
8097
  status: string;
7978
- tenant_id: string;
7979
8098
  updated_at: string;
7980
8099
  user_id: string;
7981
8100
  };
@@ -7993,7 +8112,6 @@ export type Database = {
7993
8112
  start_date: string;
7994
8113
  start_time?: string | null;
7995
8114
  status?: string;
7996
- tenant_id?: string;
7997
8115
  updated_at?: string;
7998
8116
  user_id: string;
7999
8117
  };
@@ -8011,7 +8129,6 @@ export type Database = {
8011
8129
  start_date?: string;
8012
8130
  start_time?: string | null;
8013
8131
  status?: string;
8014
- tenant_id?: string;
8015
8132
  updated_at?: string;
8016
8133
  user_id?: string;
8017
8134
  };
@@ -8020,14 +8137,14 @@ export type Database = {
8020
8137
  foreignKeyName: "leave_requests_monteur_id_fkey";
8021
8138
  columns: ["monteur_id"];
8022
8139
  isOneToOne: false;
8023
- referencedRelation: "monteurs";
8140
+ referencedRelation: "profiles";
8024
8141
  referencedColumns: ["id"];
8025
8142
  },
8026
8143
  {
8027
8144
  foreignKeyName: "leave_requests_user_id_fkey";
8028
8145
  columns: ["user_id"];
8029
8146
  isOneToOne: false;
8030
- referencedRelation: "monteurs";
8147
+ referencedRelation: "profiles";
8031
8148
  referencedColumns: ["id"];
8032
8149
  }
8033
8150
  ];
@@ -10235,6 +10352,94 @@ export type Database = {
10235
10352
  };
10236
10353
  Relationships: [];
10237
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
+ };
10238
10443
  module_permissions: {
10239
10444
  Row: {
10240
10445
  created_at: string;
@@ -10343,65 +10548,6 @@ export type Database = {
10343
10548
  };
10344
10549
  Relationships: [];
10345
10550
  };
10346
- monteurs: {
10347
- Row: {
10348
- avatar_url: string | null;
10349
- color: string | null;
10350
- created_at: string;
10351
- email: string | null;
10352
- id: string;
10353
- is_active: boolean;
10354
- leave_balance_hours: number;
10355
- name: string;
10356
- persnr: number | null;
10357
- phone: string | null;
10358
- role: string;
10359
- tenant_id: string;
10360
- updated_at: string;
10361
- user_id: string | null;
10362
- };
10363
- Insert: {
10364
- avatar_url?: string | null;
10365
- color?: string | null;
10366
- created_at?: string;
10367
- email?: string | null;
10368
- id?: string;
10369
- is_active?: boolean;
10370
- leave_balance_hours?: number;
10371
- name: string;
10372
- persnr?: number | null;
10373
- phone?: string | null;
10374
- role?: string;
10375
- tenant_id: string;
10376
- updated_at?: string;
10377
- user_id?: string | null;
10378
- };
10379
- Update: {
10380
- avatar_url?: string | null;
10381
- color?: string | null;
10382
- created_at?: string;
10383
- email?: string | null;
10384
- id?: string;
10385
- is_active?: boolean;
10386
- leave_balance_hours?: number;
10387
- name?: string;
10388
- persnr?: number | null;
10389
- phone?: string | null;
10390
- role?: string;
10391
- tenant_id?: string;
10392
- updated_at?: string;
10393
- user_id?: string | null;
10394
- };
10395
- Relationships: [
10396
- {
10397
- foreignKeyName: "monteurs_tenant_id_fkey";
10398
- columns: ["tenant_id"];
10399
- isOneToOne: false;
10400
- referencedRelation: "tenants";
10401
- referencedColumns: ["id"];
10402
- }
10403
- ];
10404
- };
10405
10551
  nmbrs_component_mapping: {
10406
10552
  Row: {
10407
10553
  created_at: string;
@@ -10474,15 +10620,7 @@ export type Database = {
10474
10620
  nmbrs_employee_number?: string;
10475
10621
  updated_at?: string;
10476
10622
  };
10477
- Relationships: [
10478
- {
10479
- foreignKeyName: "nmbrs_employee_mapping_monteur_id_fkey";
10480
- columns: ["monteur_id"];
10481
- isOneToOne: true;
10482
- referencedRelation: "monteurs";
10483
- referencedColumns: ["id"];
10484
- }
10485
- ];
10623
+ Relationships: [];
10486
10624
  };
10487
10625
  nmbrs_export_lines: {
10488
10626
  Row: {
@@ -10531,13 +10669,6 @@ export type Database = {
10531
10669
  wage_code?: string;
10532
10670
  };
10533
10671
  Relationships: [
10534
- {
10535
- foreignKeyName: "nmbrs_export_lines_monteur_id_fkey";
10536
- columns: ["monteur_id"];
10537
- isOneToOne: false;
10538
- referencedRelation: "monteurs";
10539
- referencedColumns: ["id"];
10540
- },
10541
10672
  {
10542
10673
  foreignKeyName: "nmbrs_export_lines_run_id_fkey";
10543
10674
  columns: ["run_id"];
@@ -14606,6 +14737,100 @@ export type Database = {
14606
14737
  }
14607
14738
  ];
14608
14739
  };
14740
+ role_assignments: {
14741
+ Row: {
14742
+ created_at: string;
14743
+ id: string;
14744
+ role_id: string;
14745
+ user_id: string;
14746
+ };
14747
+ Insert: {
14748
+ created_at?: string;
14749
+ id?: string;
14750
+ role_id: string;
14751
+ user_id: string;
14752
+ };
14753
+ Update: {
14754
+ created_at?: string;
14755
+ id?: string;
14756
+ role_id?: string;
14757
+ user_id?: string;
14758
+ };
14759
+ Relationships: [
14760
+ {
14761
+ foreignKeyName: "role_assignments_role_id_fkey";
14762
+ columns: ["role_id"];
14763
+ isOneToOne: false;
14764
+ referencedRelation: "roles";
14765
+ referencedColumns: ["id"];
14766
+ }
14767
+ ];
14768
+ };
14769
+ role_permissions: {
14770
+ Row: {
14771
+ can_edit: boolean;
14772
+ can_view: boolean;
14773
+ feature_id: string;
14774
+ id: string;
14775
+ module_id: string;
14776
+ role_id: string;
14777
+ updated_at: string;
14778
+ };
14779
+ Insert: {
14780
+ can_edit?: boolean;
14781
+ can_view?: boolean;
14782
+ feature_id?: string;
14783
+ id?: string;
14784
+ module_id: string;
14785
+ role_id: string;
14786
+ updated_at?: string;
14787
+ };
14788
+ Update: {
14789
+ can_edit?: boolean;
14790
+ can_view?: boolean;
14791
+ feature_id?: string;
14792
+ id?: string;
14793
+ module_id?: string;
14794
+ role_id?: string;
14795
+ updated_at?: string;
14796
+ };
14797
+ Relationships: [
14798
+ {
14799
+ foreignKeyName: "role_permissions_role_id_fkey";
14800
+ columns: ["role_id"];
14801
+ isOneToOne: false;
14802
+ referencedRelation: "roles";
14803
+ referencedColumns: ["id"];
14804
+ }
14805
+ ];
14806
+ };
14807
+ roles: {
14808
+ Row: {
14809
+ created_at: string;
14810
+ id: string;
14811
+ is_protected: boolean;
14812
+ key: string;
14813
+ name: string;
14814
+ updated_at: string;
14815
+ };
14816
+ Insert: {
14817
+ created_at?: string;
14818
+ id?: string;
14819
+ is_protected?: boolean;
14820
+ key: string;
14821
+ name: string;
14822
+ updated_at?: string;
14823
+ };
14824
+ Update: {
14825
+ created_at?: string;
14826
+ id?: string;
14827
+ is_protected?: boolean;
14828
+ key?: string;
14829
+ name?: string;
14830
+ updated_at?: string;
14831
+ };
14832
+ Relationships: [];
14833
+ };
14609
14834
  rooms: {
14610
14835
  Row: {
14611
14836
  capacity: number;
@@ -15286,6 +15511,56 @@ export type Database = {
15286
15511
  };
15287
15512
  Relationships: [];
15288
15513
  };
15514
+ time_compensation_entries: {
15515
+ Row: {
15516
+ created_at: string;
15517
+ employee_id: string;
15518
+ entry_date: string;
15519
+ id: string;
15520
+ km: number;
15521
+ meal_allowance: number;
15522
+ notes: string | null;
15523
+ standby_evening: number;
15524
+ standby_weekend: number;
15525
+ tvt_change: number;
15526
+ updated_at: string;
15527
+ };
15528
+ Insert: {
15529
+ created_at?: string;
15530
+ employee_id: string;
15531
+ entry_date: string;
15532
+ id?: string;
15533
+ km?: number;
15534
+ meal_allowance?: number;
15535
+ notes?: string | null;
15536
+ standby_evening?: number;
15537
+ standby_weekend?: number;
15538
+ tvt_change?: number;
15539
+ updated_at?: string;
15540
+ };
15541
+ Update: {
15542
+ created_at?: string;
15543
+ employee_id?: string;
15544
+ entry_date?: string;
15545
+ id?: string;
15546
+ km?: number;
15547
+ meal_allowance?: number;
15548
+ notes?: string | null;
15549
+ standby_evening?: number;
15550
+ standby_weekend?: number;
15551
+ tvt_change?: number;
15552
+ updated_at?: string;
15553
+ };
15554
+ Relationships: [
15555
+ {
15556
+ foreignKeyName: "time_compensation_entries_employee_id_fkey";
15557
+ columns: ["employee_id"];
15558
+ isOneToOne: false;
15559
+ referencedRelation: "profiles";
15560
+ referencedColumns: ["id"];
15561
+ }
15562
+ ];
15563
+ };
15289
15564
  time_entries: {
15290
15565
  Row: {
15291
15566
  created_at: string;
@@ -15320,68 +15595,174 @@ export type Database = {
15320
15595
  undertime?: number;
15321
15596
  updated_at?: string;
15322
15597
  };
15598
+ Relationships: [];
15599
+ };
15600
+ time_log_week_approvals: {
15601
+ Row: {
15602
+ approved_at: string | null;
15603
+ approved_by: string | null;
15604
+ created_at: string;
15605
+ employee_id: string;
15606
+ id: string;
15607
+ locked: boolean;
15608
+ notes: string | null;
15609
+ status: string;
15610
+ submitted_at: string | null;
15611
+ updated_at: string;
15612
+ week_start: string;
15613
+ };
15614
+ Insert: {
15615
+ approved_at?: string | null;
15616
+ approved_by?: string | null;
15617
+ created_at?: string;
15618
+ employee_id: string;
15619
+ id?: string;
15620
+ locked?: boolean;
15621
+ notes?: string | null;
15622
+ status?: string;
15623
+ submitted_at?: string | null;
15624
+ updated_at?: string;
15625
+ week_start: string;
15626
+ };
15627
+ Update: {
15628
+ approved_at?: string | null;
15629
+ approved_by?: string | null;
15630
+ created_at?: string;
15631
+ employee_id?: string;
15632
+ id?: string;
15633
+ locked?: boolean;
15634
+ notes?: string | null;
15635
+ status?: string;
15636
+ submitted_at?: string | null;
15637
+ updated_at?: string;
15638
+ week_start?: string;
15639
+ };
15323
15640
  Relationships: [
15324
15641
  {
15325
- foreignKeyName: "time_entries_employee_id_fkey";
15642
+ foreignKeyName: "time_log_week_approvals_employee_id_fkey";
15326
15643
  columns: ["employee_id"];
15327
15644
  isOneToOne: false;
15328
- referencedRelation: "monteurs";
15645
+ referencedRelation: "profiles";
15329
15646
  referencedColumns: ["id"];
15330
15647
  }
15331
15648
  ];
15332
15649
  };
15333
15650
  time_logs: {
15334
15651
  Row: {
15652
+ auto_stop_reason: string | null;
15653
+ auto_stopped: boolean;
15335
15654
  created_at: string;
15655
+ current_latitude: number | null;
15656
+ current_longitude: number | null;
15657
+ current_position_updated_at: string | null;
15336
15658
  employee_id: string;
15659
+ end_latitude: number | null;
15660
+ end_longitude: number | null;
15337
15661
  end_time: string | null;
15662
+ eta_distance_km: number | null;
15663
+ eta_minutes: number | null;
15664
+ eta_updated_at: string | null;
15665
+ hour_category: string | null;
15338
15666
  id: string;
15667
+ last_reminder_at: string | null;
15339
15668
  notes: string | null;
15340
15669
  overtime_hours: number;
15341
15670
  overtime_type: string | null;
15342
15671
  regular_hours: number;
15672
+ reminder_count: number;
15673
+ requires_review: boolean;
15674
+ start_latitude: number | null;
15675
+ start_longitude: number | null;
15343
15676
  start_time: string;
15344
15677
  travel_cost: number | null;
15345
15678
  travel_distance_km: number | null;
15679
+ travel_duration_min: number | null;
15680
+ travel_time_minutes: number | null;
15346
15681
  type: string;
15347
15682
  updated_at: string;
15683
+ work_order_id: string | null;
15348
15684
  };
15349
15685
  Insert: {
15686
+ auto_stop_reason?: string | null;
15687
+ auto_stopped?: boolean;
15350
15688
  created_at?: string;
15689
+ current_latitude?: number | null;
15690
+ current_longitude?: number | null;
15691
+ current_position_updated_at?: string | null;
15351
15692
  employee_id: string;
15693
+ end_latitude?: number | null;
15694
+ end_longitude?: number | null;
15352
15695
  end_time?: string | null;
15696
+ eta_distance_km?: number | null;
15697
+ eta_minutes?: number | null;
15698
+ eta_updated_at?: string | null;
15699
+ hour_category?: string | null;
15353
15700
  id?: string;
15701
+ last_reminder_at?: string | null;
15354
15702
  notes?: string | null;
15355
15703
  overtime_hours?: number;
15356
15704
  overtime_type?: string | null;
15357
15705
  regular_hours?: number;
15706
+ reminder_count?: number;
15707
+ requires_review?: boolean;
15708
+ start_latitude?: number | null;
15709
+ start_longitude?: number | null;
15358
15710
  start_time?: string;
15359
15711
  travel_cost?: number | null;
15360
15712
  travel_distance_km?: number | null;
15713
+ travel_duration_min?: number | null;
15714
+ travel_time_minutes?: number | null;
15361
15715
  type: string;
15362
15716
  updated_at?: string;
15717
+ work_order_id?: string | null;
15363
15718
  };
15364
15719
  Update: {
15720
+ auto_stop_reason?: string | null;
15721
+ auto_stopped?: boolean;
15365
15722
  created_at?: string;
15723
+ current_latitude?: number | null;
15724
+ current_longitude?: number | null;
15725
+ current_position_updated_at?: string | null;
15366
15726
  employee_id?: string;
15727
+ end_latitude?: number | null;
15728
+ end_longitude?: number | null;
15367
15729
  end_time?: string | null;
15730
+ eta_distance_km?: number | null;
15731
+ eta_minutes?: number | null;
15732
+ eta_updated_at?: string | null;
15733
+ hour_category?: string | null;
15368
15734
  id?: string;
15735
+ last_reminder_at?: string | null;
15369
15736
  notes?: string | null;
15370
15737
  overtime_hours?: number;
15371
15738
  overtime_type?: string | null;
15372
15739
  regular_hours?: number;
15740
+ reminder_count?: number;
15741
+ requires_review?: boolean;
15742
+ start_latitude?: number | null;
15743
+ start_longitude?: number | null;
15373
15744
  start_time?: string;
15374
15745
  travel_cost?: number | null;
15375
15746
  travel_distance_km?: number | null;
15747
+ travel_duration_min?: number | null;
15748
+ travel_time_minutes?: number | null;
15376
15749
  type?: string;
15377
15750
  updated_at?: string;
15751
+ work_order_id?: string | null;
15378
15752
  };
15379
15753
  Relationships: [
15380
15754
  {
15381
15755
  foreignKeyName: "time_logs_employee_id_fkey";
15382
15756
  columns: ["employee_id"];
15383
15757
  isOneToOne: false;
15384
- referencedRelation: "monteurs";
15758
+ referencedRelation: "profiles";
15759
+ referencedColumns: ["id"];
15760
+ },
15761
+ {
15762
+ foreignKeyName: "time_logs_work_order_id_fkey";
15763
+ columns: ["work_order_id"];
15764
+ isOneToOne: false;
15765
+ referencedRelation: "work_orders";
15385
15766
  referencedColumns: ["id"];
15386
15767
  }
15387
15768
  ];
@@ -15422,7 +15803,7 @@ export type Database = {
15422
15803
  foreignKeyName: "time_off_entries_employee_id_fkey";
15423
15804
  columns: ["employee_id"];
15424
15805
  isOneToOne: false;
15425
- referencedRelation: "monteurs";
15806
+ referencedRelation: "profiles";
15426
15807
  referencedColumns: ["id"];
15427
15808
  }
15428
15809
  ];
@@ -15735,6 +16116,39 @@ export type Database = {
15735
16116
  };
15736
16117
  Relationships: [];
15737
16118
  };
16119
+ twinfield_cron_locks: {
16120
+ Row: {
16121
+ created_at: string;
16122
+ heartbeat_at: string;
16123
+ job_name: string;
16124
+ last_error: string | null;
16125
+ last_finished_at: string | null;
16126
+ locked_at: string;
16127
+ run_id: string;
16128
+ updated_at: string;
16129
+ };
16130
+ Insert: {
16131
+ created_at?: string;
16132
+ heartbeat_at?: string;
16133
+ job_name: string;
16134
+ last_error?: string | null;
16135
+ last_finished_at?: string | null;
16136
+ locked_at?: string;
16137
+ run_id?: string;
16138
+ updated_at?: string;
16139
+ };
16140
+ Update: {
16141
+ created_at?: string;
16142
+ heartbeat_at?: string;
16143
+ job_name?: string;
16144
+ last_error?: string | null;
16145
+ last_finished_at?: string | null;
16146
+ locked_at?: string;
16147
+ run_id?: string;
16148
+ updated_at?: string;
16149
+ };
16150
+ Relationships: [];
16151
+ };
15738
16152
  twinfield_customers: {
15739
16153
  Row: {
15740
16154
  address: string | null;
@@ -16345,6 +16759,7 @@ export type Database = {
16345
16759
  twinfield_push_queue: {
16346
16760
  Row: {
16347
16761
  action: string;
16762
+ attempt_started_at: string | null;
16348
16763
  attempts: number;
16349
16764
  connection_id: string | null;
16350
16765
  created_at: string;
@@ -16361,6 +16776,7 @@ export type Database = {
16361
16776
  };
16362
16777
  Insert: {
16363
16778
  action?: string;
16779
+ attempt_started_at?: string | null;
16364
16780
  attempts?: number;
16365
16781
  connection_id?: string | null;
16366
16782
  created_at?: string;
@@ -16377,6 +16793,7 @@ export type Database = {
16377
16793
  };
16378
16794
  Update: {
16379
16795
  action?: string;
16796
+ attempt_started_at?: string | null;
16380
16797
  attempts?: number;
16381
16798
  connection_id?: string | null;
16382
16799
  created_at?: string;
@@ -16579,15 +16996,7 @@ export type Database = {
16579
16996
  workday_end?: string | null;
16580
16997
  workday_start?: string | null;
16581
16998
  };
16582
- Relationships: [
16583
- {
16584
- foreignKeyName: "uren_cao_profiles_monteur_id_fkey";
16585
- columns: ["monteur_id"];
16586
- isOneToOne: true;
16587
- referencedRelation: "monteurs";
16588
- referencedColumns: ["id"];
16589
- }
16590
- ];
16999
+ Relationships: [];
16591
17000
  };
16592
17001
  uren_entries: {
16593
17002
  Row: {
@@ -16633,13 +17042,6 @@ export type Database = {
16633
17042
  werkbon_id?: string | null;
16634
17043
  };
16635
17044
  Relationships: [
16636
- {
16637
- foreignKeyName: "uren_entries_monteur_id_fkey";
16638
- columns: ["monteur_id"];
16639
- isOneToOne: false;
16640
- referencedRelation: "monteurs";
16641
- referencedColumns: ["id"];
16642
- },
16643
17045
  {
16644
17046
  foreignKeyName: "uren_entries_werkbon_id_fkey";
16645
17047
  columns: ["werkbon_id"];
@@ -17121,19 +17523,12 @@ export type Database = {
17121
17523
  submitted_at?: string | null;
17122
17524
  updated_at?: string;
17123
17525
  };
17124
- Relationships: [
17125
- {
17126
- foreignKeyName: "uren_weekstaten_monteur_id_fkey";
17127
- columns: ["monteur_id"];
17128
- isOneToOne: false;
17129
- referencedRelation: "monteurs";
17130
- referencedColumns: ["id"];
17131
- }
17132
- ];
17526
+ Relationships: [];
17133
17527
  };
17134
17528
  user_module_permissions: {
17135
17529
  Row: {
17136
17530
  created_at: string;
17531
+ feature_id: string;
17137
17532
  id: string;
17138
17533
  module_id: string;
17139
17534
  permission: string;
@@ -17142,6 +17537,7 @@ export type Database = {
17142
17537
  };
17143
17538
  Insert: {
17144
17539
  created_at?: string;
17540
+ feature_id?: string;
17145
17541
  id?: string;
17146
17542
  module_id: string;
17147
17543
  permission: string;
@@ -17150,6 +17546,7 @@ export type Database = {
17150
17546
  };
17151
17547
  Update: {
17152
17548
  created_at?: string;
17549
+ feature_id?: string;
17153
17550
  id?: string;
17154
17551
  module_id?: string;
17155
17552
  permission?: string;
@@ -17187,6 +17584,53 @@ export type Database = {
17187
17584
  }
17188
17585
  ];
17189
17586
  };
17587
+ van_inventories: {
17588
+ Row: {
17589
+ barcode: string | null;
17590
+ created_at: string;
17591
+ id: string;
17592
+ monteur_id: string | null;
17593
+ price_per_unit: number;
17594
+ product_name: string;
17595
+ quantity_current: number;
17596
+ quantity_min: number;
17597
+ unit: string;
17598
+ updated_at: string;
17599
+ };
17600
+ Insert: {
17601
+ barcode?: string | null;
17602
+ created_at?: string;
17603
+ id?: string;
17604
+ monteur_id?: string | null;
17605
+ price_per_unit?: number;
17606
+ product_name: string;
17607
+ quantity_current?: number;
17608
+ quantity_min?: number;
17609
+ unit?: string;
17610
+ updated_at?: string;
17611
+ };
17612
+ Update: {
17613
+ barcode?: string | null;
17614
+ created_at?: string;
17615
+ id?: string;
17616
+ monteur_id?: string | null;
17617
+ price_per_unit?: number;
17618
+ product_name?: string;
17619
+ quantity_current?: number;
17620
+ quantity_min?: number;
17621
+ unit?: string;
17622
+ updated_at?: string;
17623
+ };
17624
+ Relationships: [
17625
+ {
17626
+ foreignKeyName: "van_inventories_monteur_id_fkey";
17627
+ columns: ["monteur_id"];
17628
+ isOneToOne: false;
17629
+ referencedRelation: "profiles";
17630
+ referencedColumns: ["id"];
17631
+ }
17632
+ ];
17633
+ };
17190
17634
  voorraad_custom_fields: {
17191
17635
  Row: {
17192
17636
  created_at: string;
@@ -18160,7 +18604,7 @@ export type Database = {
18160
18604
  foreignKeyName: "work_order_monteurs_monteur_id_fkey";
18161
18605
  columns: ["monteur_id"];
18162
18606
  isOneToOne: false;
18163
- referencedRelation: "monteurs";
18607
+ referencedRelation: "profiles";
18164
18608
  referencedColumns: ["id"];
18165
18609
  },
18166
18610
  {
@@ -18172,6 +18616,63 @@ export type Database = {
18172
18616
  }
18173
18617
  ];
18174
18618
  };
18619
+ work_order_photos: {
18620
+ Row: {
18621
+ ai_caption: string | null;
18622
+ ai_categorized_at: string | null;
18623
+ ai_labels: Json | null;
18624
+ caption: string | null;
18625
+ created_at: string;
18626
+ id: string;
18627
+ monteur_id: string | null;
18628
+ photo_type: string;
18629
+ storage_path: string;
18630
+ updated_at: string;
18631
+ work_order_id: string;
18632
+ };
18633
+ Insert: {
18634
+ ai_caption?: string | null;
18635
+ ai_categorized_at?: string | null;
18636
+ ai_labels?: Json | null;
18637
+ caption?: string | null;
18638
+ created_at?: string;
18639
+ id?: string;
18640
+ monteur_id?: string | null;
18641
+ photo_type?: string;
18642
+ storage_path: string;
18643
+ updated_at?: string;
18644
+ work_order_id: string;
18645
+ };
18646
+ Update: {
18647
+ ai_caption?: string | null;
18648
+ ai_categorized_at?: string | null;
18649
+ ai_labels?: Json | null;
18650
+ caption?: string | null;
18651
+ created_at?: string;
18652
+ id?: string;
18653
+ monteur_id?: string | null;
18654
+ photo_type?: string;
18655
+ storage_path?: string;
18656
+ updated_at?: string;
18657
+ work_order_id?: string;
18658
+ };
18659
+ Relationships: [
18660
+ {
18661
+ foreignKeyName: "work_order_photos_monteur_id_fkey";
18662
+ columns: ["monteur_id"];
18663
+ isOneToOne: false;
18664
+ referencedRelation: "profiles";
18665
+ referencedColumns: ["id"];
18666
+ },
18667
+ {
18668
+ foreignKeyName: "work_order_photos_work_order_id_fkey";
18669
+ columns: ["work_order_id"];
18670
+ isOneToOne: false;
18671
+ referencedRelation: "work_orders";
18672
+ referencedColumns: ["id"];
18673
+ }
18674
+ ];
18675
+ };
18175
18676
  work_orders: {
18176
18677
  Row: {
18177
18678
  assigned_to: string | null;
@@ -18203,7 +18704,6 @@ export type Database = {
18203
18704
  scheduled_end_time: string | null;
18204
18705
  scheduled_start_time: string | null;
18205
18706
  status: string;
18206
- tenant_id: string;
18207
18707
  total_hours_worked: number | null;
18208
18708
  total_price: number | null;
18209
18709
  travel_time_minutes: number | null;
@@ -18241,7 +18741,6 @@ export type Database = {
18241
18741
  scheduled_end_time?: string | null;
18242
18742
  scheduled_start_time?: string | null;
18243
18743
  status?: string;
18244
- tenant_id: string;
18245
18744
  total_hours_worked?: number | null;
18246
18745
  total_price?: number | null;
18247
18746
  travel_time_minutes?: number | null;
@@ -18279,7 +18778,6 @@ export type Database = {
18279
18778
  scheduled_end_time?: string | null;
18280
18779
  scheduled_start_time?: string | null;
18281
18780
  status?: string;
18282
- tenant_id?: string;
18283
18781
  total_hours_worked?: number | null;
18284
18782
  total_price?: number | null;
18285
18783
  travel_time_minutes?: number | null;
@@ -18294,13 +18792,6 @@ export type Database = {
18294
18792
  isOneToOne: false;
18295
18793
  referencedRelation: "work_orders";
18296
18794
  referencedColumns: ["id"];
18297
- },
18298
- {
18299
- foreignKeyName: "work_orders_tenant_id_fkey";
18300
- columns: ["tenant_id"];
18301
- isOneToOne: false;
18302
- referencedRelation: "tenants";
18303
- referencedColumns: ["id"];
18304
18795
  }
18305
18796
  ];
18306
18797
  };
@@ -19049,6 +19540,10 @@ export type Database = {
19049
19540
  };
19050
19541
  Returns: number;
19051
19542
  };
19543
+ can_manage_hours: {
19544
+ Args: never;
19545
+ Returns: boolean;
19546
+ };
19052
19547
  check_offer_product_available_stock: {
19053
19548
  Args: {
19054
19549
  p_campaign_product_id: string;
@@ -19238,6 +19733,7 @@ export type Database = {
19238
19733
  };
19239
19734
  Returns: {
19240
19735
  action: string;
19736
+ attempt_started_at: string | null;
19241
19737
  attempts: number;
19242
19738
  connection_id: string | null;
19243
19739
  created_at: string;
@@ -19325,6 +19821,30 @@ export type Database = {
19325
19821
  agent_naam: string;
19326
19822
  }[];
19327
19823
  };
19824
+ consume_van_inventory: {
19825
+ Args: {
19826
+ p_inventory_id: string;
19827
+ p_quantity: number;
19828
+ };
19829
+ Returns: {
19830
+ barcode: string | null;
19831
+ created_at: string;
19832
+ id: string;
19833
+ monteur_id: string | null;
19834
+ price_per_unit: number;
19835
+ product_name: string;
19836
+ quantity_current: number;
19837
+ quantity_min: number;
19838
+ unit: string;
19839
+ updated_at: string;
19840
+ };
19841
+ SetofOptions: {
19842
+ from: "*";
19843
+ to: "van_inventories";
19844
+ isOneToOne: true;
19845
+ isSetofReturn: false;
19846
+ };
19847
+ };
19328
19848
  control_get_todays_carts: {
19329
19849
  Args: never;
19330
19850
  Returns: {
@@ -19398,6 +19918,13 @@ export type Database = {
19398
19918
  _user_id: string;
19399
19919
  };
19400
19920
  Returns: string;
19921
+ } | {
19922
+ Args: {
19923
+ _feature_id?: string;
19924
+ _module_id: string;
19925
+ _user_id: string;
19926
+ };
19927
+ Returns: string;
19401
19928
  };
19402
19929
  email_auth_decrypt: {
19403
19930
  Args: {
@@ -19749,12 +20276,6 @@ export type Database = {
19749
20276
  Args: never;
19750
20277
  Returns: string;
19751
20278
  };
19752
- get_work_order_tenant_id: {
19753
- Args: {
19754
- wo_id: string;
19755
- };
19756
- Returns: string;
19757
- };
19758
20279
  has_module_permission: {
19759
20280
  Args: {
19760
20281
  _min: string;
@@ -19788,6 +20309,13 @@ export type Database = {
19788
20309
  };
19789
20310
  Returns: boolean;
19790
20311
  };
20312
+ is_time_log_week_locked: {
20313
+ Args: {
20314
+ p_employee_id: string;
20315
+ p_start_time: string;
20316
+ };
20317
+ Returns: boolean;
20318
+ };
19791
20319
  is_user_admin: {
19792
20320
  Args: never;
19793
20321
  Returns: boolean;
@@ -19802,13 +20330,14 @@ export type Database = {
19802
20330
  };
19803
20331
  Returns: boolean;
19804
20332
  };
19805
- list_monteurs: {
20333
+ list_medewerkers: {
19806
20334
  Args: never;
19807
20335
  Returns: {
19808
20336
  avatar_url: string;
19809
20337
  display_name: string;
19810
20338
  email: string;
19811
20339
  id: string;
20340
+ roles: string[];
19812
20341
  }[];
19813
20342
  };
19814
20343
  list_my_planning_items: {
@@ -20599,6 +21128,7 @@ export type Database = {
20599
21128
  my_module_permissions: {
20600
21129
  Args: never;
20601
21130
  Returns: {
21131
+ feature_id: string;
20602
21132
  module_id: string;
20603
21133
  permission: string;
20604
21134
  }[];
@@ -21479,6 +22009,16 @@ export type Database = {
21479
22009
  };
21480
22010
  Returns: string[];
21481
22011
  };
22012
+ switch_time_log: {
22013
+ Args: {
22014
+ p_employee_id: string;
22015
+ p_start_lat?: number;
22016
+ p_start_lng?: number;
22017
+ p_type: string;
22018
+ p_work_order_id?: string;
22019
+ };
22020
+ Returns: Json;
22021
+ };
21482
22022
  sync_all_layer_stocks: {
21483
22023
  Args: never;
21484
22024
  Returns: undefined;
@@ -21529,6 +22069,24 @@ export type Database = {
21529
22069
  };
21530
22070
  Returns: boolean;
21531
22071
  };
22072
+ twinfield_cron_lock_acquire: {
22073
+ Args: {
22074
+ _job_name: string;
22075
+ _stale_seconds?: number;
22076
+ };
22077
+ Returns: boolean;
22078
+ };
22079
+ twinfield_cron_lock_release: {
22080
+ Args: {
22081
+ _error?: string;
22082
+ _job_name: string;
22083
+ };
22084
+ Returns: undefined;
22085
+ };
22086
+ twinfield_prune_push_queue: {
22087
+ Args: never;
22088
+ Returns: number;
22089
+ };
21532
22090
  twinfield_register_cron: {
21533
22091
  Args: {
21534
22092
  apikey?: string;